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

Unified Diff: sandbox/linux/tests/main.cc

Issue 1147463003: Linux sandbox: support build configuration without base test framework (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
Index: sandbox/linux/tests/main.cc
diff --git a/sandbox/linux/tests/main.cc b/sandbox/linux/tests/main.cc
index 687c8bb087019f9020cd93297f0a8bebf143671d..d836fb4fc90644f6233c5e80f7462b1aeb120357 100644
--- a/sandbox/linux/tests/main.cc
+++ b/sandbox/linux/tests/main.cc
@@ -36,7 +36,7 @@ void RunPostTestsChecks(const base::FilePath& orig_cwd) {
} // namespace
} // namespace sandbox
-#if defined(OS_ANDROID)
+#if !defined(SANDBOX_USES_BASE_TEST_SUITE)
void UnitTestAssertHandler(const std::string& str) {
_exit(1);
}
@@ -44,9 +44,12 @@ void UnitTestAssertHandler(const std::string& str) {
int main(int argc, char* argv[]) {
base::CommandLine::Init(argc, argv);
- std::string client_func =
+ std::string client_func;
+#if defined(SANDBOX_USES_BASE_TEST_SUITE)
+ client_func =
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kTestChildProcess);
+#endif
if (!client_func.empty()) {
base::AtExitManager exit_manager;
return multi_process_function_list::InvokeChildProcessTest(client_func);
@@ -55,7 +58,7 @@ int main(int argc, char* argv[]) {
base::FilePath orig_cwd;
CHECK(GetCurrentDirectory(&orig_cwd));
-#if defined(OS_ANDROID)
+#if !defined(SANDBOX_USES_BASE_TEST_SUITE)
// The use of Callbacks requires an AtExitManager.
base::AtExitManager exit_manager;
testing::InitGoogleTest(&argc, argv);
@@ -69,7 +72,7 @@ int main(int argc, char* argv[]) {
// additional side effect of getting rid of gtest warnings about fork()
// safety.
::testing::FLAGS_gtest_death_test_style = "threadsafe";
-#if defined(OS_ANDROID)
+#if !defined(SANDBOX_USES_BASE_TEST_SUITE)
int tests_result = RUN_ALL_TESTS();
#else
int tests_result = base::RunUnitTestsUsingBaseTestSuite(argc, argv);

Powered by Google App Engine
This is Rietveld 408576698