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
parent e6872478
......@@ -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,
......
......@@ -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(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment