diff options
author | alexandermont <alexandermont@chromium.org> | 2015-12-15 16:57:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-16 00:57:55 +0000 |
commit | 005afed80274bf93a2ddc853c64baf3875367e7b (patch) | |
tree | e85552a2b2861a07b3ec55d45cacbb7207a5d4c7 | |
parent | 68e66bfceb698fefd4116e014365d23698291083 (diff) | |
download | chromium_src-005afed80274bf93a2ddc853c64baf3875367e7b.zip chromium_src-005afed80274bf93a2ddc853c64baf3875367e7b.tar.gz chromium_src-005afed80274bf93a2ddc853c64baf3875367e7b.tar.bz2 |
Revert of Enforce ordering in FilterTestNames. (patchset #5 id:80001 of https://codereview.chromium.org/1522303002/ )
Reason for revert:
causing test failures
Original issue's description:
> Enforce ordering in FilterTestNames.
>
> BUG=569723
>
> Committed: https://crrev.com/daeb80935df8b1532de2cf12879ea3d40a0615ae
> Cr-Commit-Position: refs/heads/master@{#365376}
TBR=jbudorick@chromium.org,mikecase@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=569723
Review URL: https://codereview.chromium.org/1532463002
Cr-Commit-Position: refs/heads/master@{#365409}
-rw-r--r-- | build/util/lib/common/unittest_util.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/build/util/lib/common/unittest_util.py b/build/util/lib/common/unittest_util.py index e2ad0e2..189f587 100644 --- a/build/util/lib/common/unittest_util.py +++ b/build/util/lib/common/unittest_util.py @@ -132,18 +132,22 @@ def FilterTestNames(all_tests, gtest_filter): positive_patterns = ['*'] if pattern_groups[0]: positive_patterns = pattern_groups[0].split(':') - negative_patterns = [] + negative_patterns = None if len(pattern_groups) > 1: negative_patterns = pattern_groups[1].split(':') tests = [] - test_set = set() - for pattern in positive_patterns: - pattern_tests = [ - test for test in all_tests - if (fnmatch.fnmatch(test, pattern) - and not any(fnmatch(test, p) for p in negative_patterns) - and test not in test_set)] - tests.extend(pattern_tests) - test_set.update(pattern_tests) + for test in all_tests: + # Test name must by matched by one positive pattern. + for pattern in positive_patterns: + if fnmatch.fnmatch(test, pattern): + break + else: + continue + # Test name must not be matched by any negative patterns. + for pattern in negative_patterns or []: + if fnmatch.fnmatch(test, pattern): + break + else: + tests += [test] return tests |