Show amount of parallelism in gtest output.
Bug: http://b/19075519
Test: ran tests
Change-Id: Ia190f728cc28e2283636e9cfea927e525d6c10c8
diff --git a/tests/gtest_main.cpp b/tests/gtest_main.cpp
index f2b7edd..aacf9ae 100644
--- a/tests/gtest_main.cpp
+++ b/tests/gtest_main.cpp
@@ -316,7 +316,7 @@
// PrettyUnitTestResultPrinter. The reason for copy is that PrettyUnitTestResultPrinter
// is defined and used in gtest.cc, which is hard to reuse.
static void OnTestIterationStartPrint(const std::vector<TestCase>& testcase_list, size_t iteration,
- int iteration_count) {
+ int iteration_count, size_t job_count) {
if (iteration_count != 1) {
printf("\nRepeating all tests (iteration %zu) . . .\n\n", iteration);
}
@@ -328,9 +328,10 @@
test_count += testcase.TestCount();
}
- printf("Running %zu %s from %zu %s.\n",
+ printf("Running %zu %s from %zu %s (%zu %s).\n",
test_count, (test_count == 1) ? "test" : "tests",
- testcase_count, (testcase_count == 1) ? "test case" : "test cases");
+ testcase_count, (testcase_count == 1) ? "test case" : "test cases",
+ job_count, (job_count == 1) ? "job" : "jobs");
fflush(stdout);
}
@@ -870,7 +871,7 @@
for (size_t iteration = 1;
iteration_count < 0 || iteration <= static_cast<size_t>(iteration_count);
++iteration) {
- OnTestIterationStartPrint(testcase_list, iteration, iteration_count);
+ OnTestIterationStartPrint(testcase_list, iteration, iteration_count, job_count);
int64_t iteration_start_time_ns = NanoTime();
time_t epoch_iteration_start_time = time(NULL);