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

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: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: base/test/launcher/test_launcher.cc
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index 1e2a95b0daa7a6813d8a844d7a46885a2ded8a03..54d7e59798b3723885a368fc7a37fb39fac84abf 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -974,11 +974,14 @@ void TestLauncher::RunTests() {
// Count tests in the binary, before we apply filter and sharding.
test_found_count_++;
+ std::string normlized_test_name = NormalizeTestName(test_name);
Paweł Hajdan Jr. 2016/10/25 18:16:59 nit: normlized -> normalized (typo)
stgao 2016/10/25 19:16:49 Done.
+
// 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(normlized_test_name, positive_test_filter_[k])) {
found = true;
break;
}
@@ -987,15 +990,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(normlized_test_name, 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;

Powered by Google App Engine
This is Rietveld 408576698