summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2015-09-29 15:11:45 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-29 15:11:45 +0000
commit4f3e3591ace36b6d86e3a1bc8b3f438989cb0618 (patch)
treeaa8b86e08ce97b8b5107e4ecc400945f485d7080 /tests
parent01030c24b0e3ace1b4cdaf415354e2f315f4f3a9 (diff)
parent93a91f0cf4f015762ac1ed57395c4c0de8ba7db3 (diff)
downloadbionic-4f3e3591ace36b6d86e3a1bc8b3f438989cb0618.zip
bionic-4f3e3591ace36b6d86e3a1bc8b3f438989cb0618.tar.gz
bionic-4f3e3591ace36b6d86e3a1bc8b3f438989cb0618.tar.bz2
am 93a91f0c: Force cts to only run one test at a time.
* commit '93a91f0cf4f015762ac1ed57395c4c0de8ba7db3': Force cts to only run one test at a time.
Diffstat (limited to 'tests')
-rw-r--r--tests/Android.mk7
-rw-r--r--tests/gtest_main.cpp10
2 files changed, 13 insertions, 4 deletions
diff --git a/tests/Android.mk b/tests/Android.mk
index cd60668..dc2e410 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -241,7 +241,12 @@ libBionicCtsGtestMain_src_files := gtest_main.cpp
libBionicCtsGtestMain_cflags := $(test_cflags)
-libBionicCtsGtestMain_cppflags := $(test_cppflags) -DUSING_GTEST_OUTPUT_FORMAT
+libBionicCtsGtestMain_cppflags := $(test_cppflags) -DUSING_GTEST_OUTPUT_FORMAT \
+
+# Temporarily fix the job count to 1 for CTS since on some devices the
+# number of online cores is incorrectly read as the total number of cores
+# in the system. When b/24376925 is fixed, this should be removed.
+libBionicCtsGtestMain_cppflags += -DJOB_COUNT_FIXED=1
module := libBionicCtsGtestMain
module_tag := optional
diff --git a/tests/gtest_main.cpp b/tests/gtest_main.cpp
index 692b7e8..5d25a4c 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);