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

Side by Side Diff: base/test/launcher/test_launcher.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « base/test/histogram_tester_unittest.cc ('k') | base/test/launcher/test_launcher_ios.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "base/at_exit.h" 11 #include "base/at_exit.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/environment.h" 14 #include "base/environment.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/files/file_util.h" 16 #include "base/files/file_util.h"
17 #include "base/files/scoped_file.h" 17 #include "base/files/scoped_file.h"
18 #include "base/format_macros.h" 18 #include "base/format_macros.h"
19 #include "base/hash.h" 19 #include "base/hash.h"
20 #include "base/lazy_instance.h" 20 #include "base/lazy_instance.h"
21 #include "base/location.h" 21 #include "base/location.h"
22 #include "base/logging.h" 22 #include "base/logging.h"
23 #include "base/memory/scoped_ptr.h" 23 #include "base/memory/scoped_ptr.h"
24 #include "base/message_loop/message_loop.h" 24 #include "base/message_loop/message_loop.h"
25 #include "base/process/kill.h" 25 #include "base/process/kill.h"
26 #include "base/process/launch.h" 26 #include "base/process/launch.h"
27 #include "base/single_thread_task_runner.h" 27 #include "base/single_thread_task_runner.h"
28 #include "base/strings/pattern.h"
28 #include "base/strings/string_number_conversions.h" 29 #include "base/strings/string_number_conversions.h"
29 #include "base/strings/string_split.h" 30 #include "base/strings/string_split.h"
30 #include "base/strings/string_util.h" 31 #include "base/strings/string_util.h"
31 #include "base/strings/stringize_macros.h" 32 #include "base/strings/stringize_macros.h"
32 #include "base/strings/stringprintf.h" 33 #include "base/strings/stringprintf.h"
33 #include "base/strings/utf_string_conversions.h" 34 #include "base/strings/utf_string_conversions.h"
34 #include "base/test/gtest_util.h" 35 #include "base/test/gtest_util.h"
35 #include "base/test/launcher/test_results_tracker.h" 36 #include "base/test/launcher/test_results_tracker.h"
36 #include "base/test/sequenced_worker_pool_owner.h" 37 #include "base/test/sequenced_worker_pool_owner.h"
37 #include "base/test/test_switches.h" 38 #include "base/test/test_switches.h"
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 if (print_snippet) { 563 if (print_snippet) {
563 std::vector<std::string> snippet_lines; 564 std::vector<std::string> snippet_lines;
564 SplitStringDontTrim(result.output_snippet, '\n', &snippet_lines); 565 SplitStringDontTrim(result.output_snippet, '\n', &snippet_lines);
565 if (snippet_lines.size() > kOutputSnippetLinesLimit) { 566 if (snippet_lines.size() > kOutputSnippetLinesLimit) {
566 size_t truncated_size = snippet_lines.size() - kOutputSnippetLinesLimit; 567 size_t truncated_size = snippet_lines.size() - kOutputSnippetLinesLimit;
567 snippet_lines.erase( 568 snippet_lines.erase(
568 snippet_lines.begin(), 569 snippet_lines.begin(),
569 snippet_lines.begin() + truncated_size); 570 snippet_lines.begin() + truncated_size);
570 snippet_lines.insert(snippet_lines.begin(), "<truncated>"); 571 snippet_lines.insert(snippet_lines.begin(), "<truncated>");
571 } 572 }
572 fprintf(stdout, "%s", JoinString(snippet_lines, "\n").c_str()); 573 fprintf(stdout, "%s", base::JoinString(snippet_lines, "\n").c_str());
573 fflush(stdout); 574 fflush(stdout);
574 } 575 }
575 576
576 if (result.status == TestResult::TEST_SUCCESS) { 577 if (result.status == TestResult::TEST_SUCCESS) {
577 ++test_success_count_; 578 ++test_success_count_;
578 } else { 579 } else {
579 tests_to_retry_.insert(result.full_name); 580 tests_to_retry_.insert(result.full_name);
580 } 581 }
581 582
582 results_tracker_.AddTestResult(result); 583 results_tracker_.AddTestResult(result);
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 } 1071 }
1071 1072
1072 std::string snippet(full_output.substr(run_pos)); 1073 std::string snippet(full_output.substr(run_pos));
1073 if (end_pos != std::string::npos) 1074 if (end_pos != std::string::npos)
1074 snippet = full_output.substr(run_pos, end_pos - run_pos); 1075 snippet = full_output.substr(run_pos, end_pos - run_pos);
1075 1076
1076 return snippet; 1077 return snippet;
1077 } 1078 }
1078 1079
1079 } // namespace base 1080 } // namespace base
OLDNEW
« no previous file with comments | « base/test/histogram_tester_unittest.cc ('k') | base/test/launcher/test_launcher_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698