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

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

Issue 2472153002: Gathering information about test filter files into a README.md file. (Closed)
Patch Set: Updated README.md to match changes made in https://crrev.com/2469353002. Created 4 years, 1 month 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 | « no previous file | base/test/launcher/unit_test_launcher.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 #include <memory> 7 #include <memory>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 835
836 if (command_line->HasSwitch(switches::kTestLauncherFilterFile)) { 836 if (command_line->HasSwitch(switches::kTestLauncherFilterFile)) {
837 base::FilePath filter_file_path = base::MakeAbsoluteFilePath( 837 base::FilePath filter_file_path = base::MakeAbsoluteFilePath(
838 command_line->GetSwitchValuePath(switches::kTestLauncherFilterFile)); 838 command_line->GetSwitchValuePath(switches::kTestLauncherFilterFile));
839 std::string filter; 839 std::string filter;
840 if (!ReadFileToString(filter_file_path, &filter)) { 840 if (!ReadFileToString(filter_file_path, &filter)) {
841 LOG(ERROR) << "Failed to read the filter file."; 841 LOG(ERROR) << "Failed to read the filter file.";
842 return false; 842 return false;
843 } 843 }
844 844
845 // Parse the file contents (see //testing/buildbot/filters/README.md
846 // for file syntax and other info).
845 std::vector<std::string> filter_lines = SplitString( 847 std::vector<std::string> filter_lines = SplitString(
846 filter, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 848 filter, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
847 for (const std::string& filter_line : filter_lines) { 849 for (const std::string& filter_line : filter_lines) {
848 if (filter_line.empty() || filter_line[0] == '#') 850 if (filter_line.empty() || filter_line[0] == '#')
849 continue; 851 continue;
850 852
851 if (filter_line[0] == '-') 853 if (filter_line[0] == '-')
852 negative_test_filter_.push_back(filter_line.substr(1)); 854 negative_test_filter_.push_back(filter_line.substr(1));
853 else 855 else
854 positive_test_filter_.push_back(filter_line); 856 positive_test_filter_.push_back(filter_line);
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 } 1168 }
1167 1169
1168 std::string snippet(full_output.substr(run_pos)); 1170 std::string snippet(full_output.substr(run_pos));
1169 if (end_pos != std::string::npos) 1171 if (end_pos != std::string::npos)
1170 snippet = full_output.substr(run_pos, end_pos - run_pos); 1172 snippet = full_output.substr(run_pos, end_pos - run_pos);
1171 1173
1172 return snippet; 1174 return snippet;
1173 } 1175 }
1174 1176
1175 } // namespace base 1177 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/test/launcher/unit_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698