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

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: Nits. 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
« no previous file with comments | « sandbox/linux/sandbox_linux_test_sources.gypi ('k') | sandbox/linux/tests/unit_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/tests/main.cc
diff --git a/sandbox/linux/tests/main.cc b/sandbox/linux/tests/main.cc
index 687c8bb087019f9020cd93297f0a8bebf143671d..caeddee32cfac67a7d040150bd08977591698a5c 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,11 @@ void UnitTestAssertHandler(const std::string& str) {
int main(int argc, char* argv[]) {
base::CommandLine::Init(argc, argv);
- std::string client_func =
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kTestChildProcess);
+ 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 +57,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 +71,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);
« no previous file with comments | « sandbox/linux/sandbox_linux_test_sources.gypi ('k') | sandbox/linux/tests/unit_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698