| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/test/launcher/test_launcher.h" | 5 #include "base/test/launcher/test_launcher.h" |
| 6 | 6 |
| 7 #if defined(OS_POSIX) | 7 #if defined(OS_POSIX) |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 if (print_snippet) { | 563 if (print_snippet) { |
| 564 std::vector<std::string> snippet_lines; | 564 std::vector<std::string> snippet_lines; |
| 565 SplitStringDontTrim(result.output_snippet, '\n', &snippet_lines); | 565 SplitStringDontTrim(result.output_snippet, '\n', &snippet_lines); |
| 566 if (snippet_lines.size() > kOutputSnippetLinesLimit) { | 566 if (snippet_lines.size() > kOutputSnippetLinesLimit) { |
| 567 size_t truncated_size = snippet_lines.size() - kOutputSnippetLinesLimit; | 567 size_t truncated_size = snippet_lines.size() - kOutputSnippetLinesLimit; |
| 568 snippet_lines.erase( | 568 snippet_lines.erase( |
| 569 snippet_lines.begin(), | 569 snippet_lines.begin(), |
| 570 snippet_lines.begin() + truncated_size); | 570 snippet_lines.begin() + truncated_size); |
| 571 snippet_lines.insert(snippet_lines.begin(), "<truncated>"); | 571 snippet_lines.insert(snippet_lines.begin(), "<truncated>"); |
| 572 } | 572 } |
| 573 fprintf(stdout, "%s", base::JoinString(snippet_lines, "\n").c_str()); | 573 fprintf(stdout, "%s", JoinString(snippet_lines, "\n").c_str()); |
| 574 fflush(stdout); | 574 fflush(stdout); |
| 575 } | 575 } |
| 576 | 576 |
| 577 if (result.status == TestResult::TEST_SUCCESS) { | 577 if (result.status == TestResult::TEST_SUCCESS) { |
| 578 ++test_success_count_; | 578 ++test_success_count_; |
| 579 } else { | 579 } else { |
| 580 tests_to_retry_.insert(result.full_name); | 580 tests_to_retry_.insert(result.full_name); |
| 581 } | 581 } |
| 582 | 582 |
| 583 results_tracker_.AddTestResult(result); | 583 results_tracker_.AddTestResult(result); |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 } | 1071 } |
| 1072 | 1072 |
| 1073 std::string snippet(full_output.substr(run_pos)); | 1073 std::string snippet(full_output.substr(run_pos)); |
| 1074 if (end_pos != std::string::npos) | 1074 if (end_pos != std::string::npos) |
| 1075 snippet = full_output.substr(run_pos, end_pos - run_pos); | 1075 snippet = full_output.substr(run_pos, end_pos - run_pos); |
| 1076 | 1076 |
| 1077 return snippet; | 1077 return snippet; |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 } // namespace base | 1080 } // namespace base |
| OLD | NEW |