aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gtest_main.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2015-09-24 18:45:53 -0700
committerChristopher Ferris <cferris@google.com>2015-09-25 15:33:20 -0700
commit93a91f0cf4f015762ac1ed57395c4c0de8ba7db3 (patch)
treeaca0bdeb626e45394191e33b982ea0b06d62fb93 /tests/gtest_main.cpp
parent829119425bcc2b5fcec8fdf219026a5192c81234 (diff)
downloadandroid_bionic-93a91f0cf4f015762ac1ed57395c4c0de8ba7db3.tar.gz
android_bionic-93a91f0cf4f015762ac1ed57395c4c0de8ba7db3.tar.bz2
android_bionic-93a91f0cf4f015762ac1ed57395c4c0de8ba7db3.zip
Force cts to only run one test at a time.
Also, slightly increase the timeout for each test run. Bug: 24198050 (cherry picked from commit daaaed18ce1d2f2da9d2240e974922299d937670) Change-Id: I29e169e962da803a89abf0a28e071abcafa315b7
Diffstat (limited to 'tests/gtest_main.cpp')
-rw-r--r--tests/gtest_main.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/gtest_main.cpp b/tests/gtest_main.cpp
index 692b7e883..5d25a4cd9 100644
--- a/tests/gtest_main.cpp
+++ b/tests/gtest_main.cpp
@@ -59,7 +59,7 @@ using testing::internal::COLOR_GREEN;
using testing::internal::COLOR_YELLOW;
using testing::internal::ColoredPrintf;
-constexpr int DEFAULT_GLOBAL_TEST_RUN_DEADLINE_MS = 60000;
+constexpr int DEFAULT_GLOBAL_TEST_RUN_DEADLINE_MS = 90000;
constexpr int DEFAULT_GLOBAL_TEST_RUN_WARNLINE_MS = 2000;
// The time each test can run before killed for the reason of timeout.
@@ -839,8 +839,12 @@ static bool RunTestInSeparateProc(int argc, char** argv, std::vector<TestCase>&
return all_tests_passed;
}
-static size_t GetProcessorCount() {
+static size_t GetDefaultJobCount() {
+#if defined(JOB_COUNT_FIXED)
+ return JOB_COUNT_FIXED;
+#else
return static_cast<size_t>(sysconf(_SC_NPROCESSORS_ONLN));
+#endif
}
static void AddPathSeparatorInTestProgramPath(std::vector<char*>& args) {
@@ -950,7 +954,7 @@ static bool PickOptions(std::vector<char*>& args, IsolationTestOptions& options)
}
// Init default isolation test options.
- options.job_count = GetProcessorCount();
+ options.job_count = GetDefaultJobCount();
options.test_deadline_ms = DEFAULT_GLOBAL_TEST_RUN_DEADLINE_MS;
options.test_warnline_ms = DEFAULT_GLOBAL_TEST_RUN_WARNLINE_MS;
options.gtest_color = testing::GTEST_FLAG(color);