| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/test/test_suite.h" | 7 #include "base/test/test_suite.h" |
| 8 #include "sandbox/linux/tests/test_utils.h" | 8 #include "sandbox/linux/tests/test_utils.h" |
| 9 #include "sandbox/linux/tests/unit_tests.h" | 9 #include "sandbox/linux/tests/unit_tests.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 namespace sandbox { | 12 namespace sandbox { |
| 13 |
| 14 extern const bool kAllowForkWithThreads = false; |
| 15 |
| 13 namespace { | 16 namespace { |
| 14 | 17 |
| 15 // Check for leaks in our tests. | 18 // Check for leaks in our tests. |
| 16 void RunPostTestsChecks() { | 19 void RunPostTestsChecks() { |
| 17 if (TestUtils::CurrentProcessHasChildren()) { | 20 if (TestUtils::CurrentProcessHasChildren()) { |
| 18 LOG(ERROR) << "One of the tests created a child that was not waited for. " | 21 LOG(ERROR) << "One of the tests created a child that was not waited for. " |
| 19 << "Please, clean-up after your tests!"; | 22 << "Please, clean-up after your tests!"; |
| 20 } | 23 } |
| 21 } | 24 } |
| 22 | 25 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 36 ::testing::FLAGS_gtest_death_test_style = "threadsafe"; | 39 ::testing::FLAGS_gtest_death_test_style = "threadsafe"; |
| 37 #if defined(OS_ANDROID) | 40 #if defined(OS_ANDROID) |
| 38 int tests_result = RUN_ALL_TESTS(); | 41 int tests_result = RUN_ALL_TESTS(); |
| 39 #else | 42 #else |
| 40 int tests_result = base::RunUnitTestsUsingBaseTestSuite(argc, argv); | 43 int tests_result = base::RunUnitTestsUsingBaseTestSuite(argc, argv); |
| 41 #endif | 44 #endif |
| 42 | 45 |
| 43 sandbox::RunPostTestsChecks(); | 46 sandbox::RunPostTestsChecks(); |
| 44 return tests_result; | 47 return tests_result; |
| 45 } | 48 } |
| OLD | NEW |