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 #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 Loading... |
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 Loading... |
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 |
OLD | NEW |