diff options
author | Yabin Cui <yabinc@google.com> | 2019-11-06 20:35:02 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-11-06 20:35:02 +0000 |
commit | ab10d26e56055a9ce3d86ebcaa0cf8ef76b82366 (patch) | |
tree | 49adbbb47d8e2a7a34ca3cb9e6c978b3e7323010 | |
parent | ffb407b4593502c7c20131a7b6dd0765a34c60a8 (diff) | |
parent | 24ff82cd94b31763fdff2823000a7f7be4135ff1 (diff) | |
download | extras-ab10d26e56055a9ce3d86ebcaa0cf8ef76b82366.tar.gz |
Merge "simpleperf: allow more than one pattern in test.py."
-rwxr-xr-x | simpleperf/scripts/test.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/simpleperf/scripts/test.py b/simpleperf/scripts/test.py index caf3fb2a..5ebf652a 100755 --- a/simpleperf/scripts/test.py +++ b/simpleperf/scripts/test.py @@ -1700,12 +1700,8 @@ def main(): log_exit("Can't find test %s" % args.test_from[0]) tests = tests[start_pos:] if args.pattern: - pattern = re.compile(fnmatch.translate(args.pattern[0])) - new_tests = [] - for test in tests: - if pattern.match(test): - new_tests.append(test) - tests = new_tests + patterns = [re.compile(fnmatch.translate(x)) for x in args.pattern] + tests = [t for t in tests if any(pattern.match(t) for pattern in patterns)] if not tests: log_exit('No tests are matched.') |