| Index: build/util/lib/common/unittest_util.py
|
| diff --git a/build/util/lib/common/unittest_util.py b/build/util/lib/common/unittest_util.py
|
| index e2ad0e2ffc26cfd43eacea9178d6137c1dde58c9..189f5871c740f046093bf36f69639407214bba78 100644
|
| --- a/build/util/lib/common/unittest_util.py
|
| +++ b/build/util/lib/common/unittest_util.py
|
| @@ -132,18 +132,22 @@
|
| 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
|
|
|