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

Unified Diff: mojo/public/cpp/application/lib/application_test_main.cc

Issue 744973002: Pass command line args to apptests (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase and address comments Created 6 years, 1 month 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
Index: mojo/public/cpp/application/lib/application_test_main.cc
diff --git a/mojo/public/cpp/application/lib/application_test_main.cc b/mojo/public/cpp/application/lib/application_test_main.cc
index 6cdfb0d7fa53eab272d69fdd3967e28ce3a0a038..65a65b25ac21d54bc60bafea053b2042369cfb05 100644
--- a/mojo/public/cpp/application/lib/application_test_main.cc
+++ b/mojo/public/cpp/application/lib/application_test_main.cc
@@ -21,14 +21,14 @@ MojoResult MojoMain(MojoHandle shell_handle) {
// Construct an ApplicationImpl just for the GTEST commandline arguments.
// GTEST command line arguments are supported amid application arguments:
- // $ mojo_shell 'mojo:example_apptests arg1 --gtest_filter=foo arg2'
+ // $ mojo_shell mojo:example_apptests \
jamesr 2014/11/24 20:22:40 this breaks the android build: FAILED: /b/build/g
+ // --args-for='mojo:example_apptests arg1 --gtest_filter=foo arg2'
mojo::ApplicationDelegate dummy_application_delegate;
mojo::ApplicationImpl app(&dummy_application_delegate, shell_handle);
MOJO_CHECK(app.WaitForInitialize());
// InitGoogleTest expects (argc + 1) elements, including a terminating NULL.
// It also removes GTEST arguments from |argv| and updates the |argc| count.
- // TODO(msw): Provide tests access to these actual command line arguments.
const std::vector<std::string>& args = app.args();
MOJO_CHECK(args.size() <
static_cast<size_t>(std::numeric_limits<int>::max()));
@@ -40,6 +40,7 @@ MojoResult MojoMain(MojoHandle shell_handle) {
testing::InitGoogleTest(&argc, const_cast<char**>(&(argv[0])));
mojo::test::SetShellHandle(app.UnbindShell());
+ mojo::test::InitializeArgs(argc, argv);
}
int result = RUN_ALL_TESTS();
« no previous file with comments | « mojo/public/cpp/application/lib/application_test_base.cc ('k') | mojo/services/network/udp_socket_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698