| 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 } | 967 } |
| 968 | 968 |
| 969 if (!launcher_delegate_->ShouldRunTest( | 969 if (!launcher_delegate_->ShouldRunTest( |
| 970 tests_[i].test_case_name, tests_[i].test_name)) { | 970 tests_[i].test_case_name, tests_[i].test_name)) { |
| 971 continue; | 971 continue; |
| 972 } | 972 } |
| 973 | 973 |
| 974 // Count tests in the binary, before we apply filter and sharding. | 974 // Count tests in the binary, before we apply filter and sharding. |
| 975 test_found_count_++; | 975 test_found_count_++; |
| 976 | 976 |
| 977 std::string test_name_no_disabled = TestNameWithoutDisabledPrefix( |
| 978 test_name); |
| 979 |
| 977 // Skip the test that doesn't match the filter (if given). | 980 // Skip the test that doesn't match the filter (if given). |
| 978 if (!positive_test_filter_.empty()) { | 981 if (!positive_test_filter_.empty()) { |
| 979 bool found = false; | 982 bool found = false; |
| 980 for (size_t k = 0; k < positive_test_filter_.size(); ++k) { | 983 for (size_t k = 0; k < positive_test_filter_.size(); ++k) { |
| 981 if (MatchPattern(test_name, positive_test_filter_[k])) { | 984 if (MatchPattern(test_name, positive_test_filter_[k]) || |
| 985 MatchPattern(test_name_no_disabled, positive_test_filter_[k])) { |
| 982 found = true; | 986 found = true; |
| 983 break; | 987 break; |
| 984 } | 988 } |
| 985 } | 989 } |
| 986 | 990 |
| 987 if (!found) | 991 if (!found) |
| 988 continue; | 992 continue; |
| 989 } | 993 } |
| 990 bool excluded = false; | 994 if (!negative_test_filter_.empty()) { |
| 991 for (size_t k = 0; k < negative_test_filter_.size(); ++k) { | 995 bool excluded = false; |
| 992 if (MatchPattern(test_name, negative_test_filter_[k])) { | 996 for (size_t k = 0; k < negative_test_filter_.size(); ++k) { |
| 993 excluded = true; | 997 if (MatchPattern(test_name, negative_test_filter_[k]) || |
| 994 break; | 998 MatchPattern(test_name_no_disabled, negative_test_filter_[k])) { |
| 999 excluded = true; |
| 1000 break; |
| 1001 } |
| 995 } | 1002 } |
| 1003 |
| 1004 if (excluded) |
| 1005 continue; |
| 996 } | 1006 } |
| 997 if (excluded) | |
| 998 continue; | |
| 999 | 1007 |
| 1000 if (Hash(test_name) % total_shards_ != static_cast<uint32_t>(shard_index_)) | 1008 if (Hash(test_name) % total_shards_ != static_cast<uint32_t>(shard_index_)) |
| 1001 continue; | 1009 continue; |
| 1002 | 1010 |
| 1003 test_names.push_back(test_name); | 1011 test_names.push_back(test_name); |
| 1004 } | 1012 } |
| 1005 | 1013 |
| 1006 // Save an early test summary in case the launcher crashes or gets killed. | 1014 // Save an early test summary in case the launcher crashes or gets killed. |
| 1007 MaybeSaveSummaryAsJSON({"EARLY_SUMMARY", kUnreliableResultsTag}); | 1015 MaybeSaveSummaryAsJSON({"EARLY_SUMMARY", kUnreliableResultsTag}); |
| 1008 | 1016 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 } | 1166 } |
| 1159 | 1167 |
| 1160 std::string snippet(full_output.substr(run_pos)); | 1168 std::string snippet(full_output.substr(run_pos)); |
| 1161 if (end_pos != std::string::npos) | 1169 if (end_pos != std::string::npos) |
| 1162 snippet = full_output.substr(run_pos, end_pos - run_pos); | 1170 snippet = full_output.substr(run_pos, end_pos - run_pos); |
| 1163 | 1171 |
| 1164 return snippet; | 1172 return snippet; |
| 1165 } | 1173 } |
| 1166 | 1174 |
| 1167 } // namespace base | 1175 } // namespace base |
| OLD | NEW |