summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 11:16:54 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 11:16:54 +0000
commit021b50df6cc6fa48432c664cdb04219edde01cac (patch)
treef878fedffb905f211604ef446f56970cf16e22cf
parente6872478e55676ac5b81c6f431ae2228cf7849b2 (diff)
downloadchromium_src-021b50df6cc6fa48432c664cdb04219edde01cac.zip
chromium_src-021b50df6cc6fa48432c664cdb04219edde01cac.tar.gz
chromium_src-021b50df6cc6fa48432c664cdb04219edde01cac.tar.bz2
Only print summary of all test iterations if there is more than one.
Also print a clear "SUCCESS" message on success. BUG=236893 R=sky@chromium.org Review URL: https://codereview.chromium.org/131663002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244147 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/test/launcher/test_launcher.cc21
-rw-r--r--base/test/launcher/test_results_tracker.cc2
2 files changed, 12 insertions, 11 deletions
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index f9c71e2..f7e1e10 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -342,6 +342,10 @@ bool TestLauncher::Run(int argc, char** argv) {
if (!Init())
return false;
+ // Value of |cycles_| changes after each iteration. Keep track of the
+ // original value.
+ int requested_cycles = cycles_;
+
#if defined(OS_POSIX)
CHECK_EQ(0, pipe(g_shutdown_pipe));
@@ -374,7 +378,7 @@ bool TestLauncher::Run(int argc, char** argv) {
MessageLoop::current()->Run();
- if (cycles_ != 1)
+ if (requested_cycles != 1)
results_tracker_.PrintSummaryOfAllIterations();
MaybeSaveSummaryAsJSON();
@@ -860,23 +864,20 @@ void TestLauncher::OnLaunchTestProcessFinished(
}
void TestLauncher::OnTestIterationFinished() {
- // The current iteration is done.
- fprintf(stdout, "%" PRIuS " test%s run\n",
- test_finished_count_,
- test_finished_count_ > 1 ? "s" : "");
- fflush(stdout);
-
- results_tracker_.PrintSummaryOfCurrentIteration();
-
// When we retry tests, success is determined by having nothing more
// to retry (everything eventually passed), as opposed to having
// no failures at all.
- if (!tests_to_retry_.empty()) {
+ if (tests_to_retry_.empty()) {
+ fprintf(stdout, "SUCCESS: all tests passed.\n");
+ fflush(stdout);
+ } else {
// Signal failure, but continue to run all requested test iterations.
// With the summary of all iterations at the end this is a good default.
run_result_ = false;
}
+ results_tracker_.PrintSummaryOfCurrentIteration();
+
// Kick off the next iteration.
MessageLoop::current()->PostTask(
FROM_HERE,
diff --git a/base/test/launcher/test_results_tracker.cc b/base/test/launcher/test_results_tracker.cc
index 9841e5c..f88a740 100644
--- a/base/test/launcher/test_results_tracker.cc
+++ b/base/test/launcher/test_results_tracker.cc
@@ -229,7 +229,7 @@ void TestResultsTracker::PrintSummaryOfAllIterations() const {
}
}
- fprintf(stdout, "Summary of all itest iterations:\n");
+ fprintf(stdout, "Summary of all test iterations:\n");
fflush(stdout);
PrintTests(tests_by_status[TestResult::TEST_FAILURE].begin(),