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

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

Issue 46043019: GTTF: Add a flag controlling handling of test stdio by the new launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/test_switches.h » ('j') | base/test/test_switches.cc » ('J')
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 9c06a1a2a12279cf39bf5fedcd7c2509f9f1bf49..75b8fdb475e5e8348cfe97ddf450b367b936e207 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -269,13 +269,32 @@ bool TestLauncher::Run(int argc, char** argv) {
void TestLauncher::OnTestFinished(const TestResult& result) {
++test_finished_count_;
+ bool print_snippet = false;
+ std::string test_stdio("auto");
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kTestLauncherTestStdio)) {
+ test_stdio = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kTestLauncherTestStdio);
+ }
+ if (test_stdio == "auto") {
+ print_snippet = (result.status != TestResult::TEST_SUCCESS);
+ } else if (test_stdio == "always") {
+ print_snippet = true;
+ } else if (test_stdio == "never") {
+ print_snippet = false;
+ } else {
+ LOG(WARNING) << "Invalid value of " << switches::kTestLauncherTestStdio
+ << ": " << test_stdio;
+ }
+ if (print_snippet) {
+ fprintf(stdout, "%s", result.output_snippet.c_str());
+ fflush(stdout);
+ }
+
if (result.status == TestResult::TEST_SUCCESS) {
++test_success_count_;
} else {
tests_to_retry_.insert(result.full_name);
-
- fprintf(stdout, "%s", result.output_snippet.c_str());
- fflush(stdout);
}
results_tracker_.AddTestResult(result);
« no previous file with comments | « no previous file | base/test/test_switches.h » ('j') | base/test/test_switches.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698