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

Unified Diff: base/test/launcher/test_launcher.cc

Issue 2439423003: test launcher: make --gtest_filter=A.B + --gtest_also_run_disabled_tests also run A.DISABLED_B or D… (Closed)
Patch Set: Just rebase. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/gtest_util.cc ('k') | base/test/launcher/test_results_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/launcher/test_launcher.cc
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index 2c4a4e21cce33952f66471936655df3ff120ba14..364cf113c6a6eed776a3059cbbf15d307fda4c33 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -974,11 +974,15 @@ void TestLauncher::RunTests() {
// Count tests in the binary, before we apply filter and sharding.
test_found_count_++;
+ std::string test_name_no_disabled = TestNameWithoutDisabledPrefix(
+ test_name);
+
// Skip the test that doesn't match the filter (if given).
if (!positive_test_filter_.empty()) {
bool found = false;
for (size_t k = 0; k < positive_test_filter_.size(); ++k) {
- if (MatchPattern(test_name, positive_test_filter_[k])) {
+ if (MatchPattern(test_name, positive_test_filter_[k]) ||
+ MatchPattern(test_name_no_disabled, positive_test_filter_[k])) {
found = true;
break;
}
@@ -987,15 +991,19 @@ void TestLauncher::RunTests() {
if (!found)
continue;
}
- bool excluded = false;
- for (size_t k = 0; k < negative_test_filter_.size(); ++k) {
- if (MatchPattern(test_name, negative_test_filter_[k])) {
- excluded = true;
- break;
+ if (!negative_test_filter_.empty()) {
+ bool excluded = false;
+ for (size_t k = 0; k < negative_test_filter_.size(); ++k) {
+ if (MatchPattern(test_name, negative_test_filter_[k]) ||
+ MatchPattern(test_name_no_disabled, negative_test_filter_[k])) {
+ excluded = true;
+ break;
+ }
}
+
+ if (excluded)
+ continue;
}
- if (excluded)
- continue;
if (Hash(test_name) % total_shards_ != static_cast<uint32_t>(shard_index_))
continue;
« no previous file with comments | « base/test/gtest_util.cc ('k') | base/test/launcher/test_results_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698