Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2788)

Unified Diff: base/test/launcher/test_launcher.cc

Issue 131663002: Only print summary of all test iterations if there is more than one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/test/launcher/test_results_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/test_launcher.cc
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index f9c71e268955b3b4f62bd57d2a38fafca44e6306..f7e1e1069bccc7eccc8cd537af8a36661ceef19e 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,
« no previous file with comments | « no previous file | base/test/launcher/test_results_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698