| 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);
|
|
|