Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(667)

Unified Diff: sky/shell/linux/main.cc

Issue 1229743002: Teach sky_shell.exe to run from a snapshot (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/mojo/net/fetch.dart ('k') | sky/shell/testing/test_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/linux/main.cc
diff --git a/sky/shell/linux/main.cc b/sky/shell/linux/main.cc
index 0ed81d3fc4fe8f2d554947733e740b065508209f..06759977a7325284f636ba28099011bf10ce5e16 100644
--- a/sky/shell/linux/main.cc
+++ b/sky/shell/linux/main.cc
@@ -27,6 +27,7 @@ void Usage() {
std::cerr << "Usage: sky_shell"
<< " --" << switches::kNonInteractive
<< " --" << switches::kPackageRoot << "=PACKAGE_ROOT"
+ << " --" << switches::kSnapshot << "=SNAPSHOT"
<< " [ MAIN_DART ]" << std::endl;
}
@@ -42,19 +43,27 @@ void Init() {
std::string package_root =
command_line.GetSwitchValueASCII(switches::kPackageRoot);
+ runner.set_package_root(package_root);
- std::string main;
- auto args = command_line.GetArgs();
- if (!args.empty())
- main = args[0];
+ scoped_ptr<TestRunner::SingleTest> single_test;
+ if (command_line.HasSwitch(switches::kSnapshot)) {
+ single_test.reset(new TestRunner::SingleTest);
+ single_test->path = command_line.GetSwitchValueASCII(switches::kSnapshot);
+ single_test->is_snapshot = true;
+ } else {
+ auto args = command_line.GetArgs();
+ if (!args.empty()) {
+ single_test.reset(new TestRunner::SingleTest);
+ single_test->path = args[0];
+ }
+ }
- runner.set_package_root(package_root);
- runner.Start(main);
+ runner.Start(single_test.Pass());
}
} // namespace
-} // namespace shell
-} // namespace sky
+} // namespace shell
+} // namespace sky
int main(int argc, const char* argv[]) {
base::AtExitManager exit_manager;
@@ -63,7 +72,8 @@ int main(int argc, const char* argv[]) {
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(sky::shell::switches::kHelp) ||
- !command_line.HasSwitch(sky::shell::switches::kPackageRoot)) {
+ (!command_line.HasSwitch(sky::shell::switches::kPackageRoot) &&
+ !command_line.HasSwitch(sky::shell::switches::kSnapshot))) {
sky::shell::Usage();
return 0;
}
« no previous file with comments | « sky/sdk/lib/mojo/net/fetch.dart ('k') | sky/shell/testing/test_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698