summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2020-08-21 00:27:09 -0700
committerGitHub <noreply@github.com>2020-08-21 00:27:09 -0700
commit4548845a9689e235894e28174bf79358960ab29d (patch)
tree183ea016cd7c65147a6dcf7d415e90098600507c /scripts
parent47b6dd223d0e8c98f8b4261302c8c5752e59b8a4 (diff)
downloadbinaryen-4548845a9689e235894e28174bf79358960ab29d.tar.gz
binaryen-4548845a9689e235894e28174bf79358960ab29d.tar.bz2
binaryen-4548845a9689e235894e28174bf79358960ab29d.zip
Use fnmatch for test filtering (#3068)
Allows for using `*` wildcards and simplifies the code!
Diffstat (limited to 'scripts')
-rw-r--r--scripts/test/shared.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/test/shared.py b/scripts/test/shared.py
index 2efa44873..9cea0e406 100644
--- a/scripts/test/shared.py
+++ b/scripts/test/shared.py
@@ -16,6 +16,7 @@ from __future__ import print_function
import argparse
import difflib
+import fnmatch
import glob
import os
import shutil
@@ -367,7 +368,7 @@ def get_tests(test_dir, extensions=[]):
for ext in extensions:
tests += glob.glob(os.path.join(test_dir, '*' + ext))
if options.test_name_filter:
- tests = list(filter(lambda n: n.find(options.test_name_filter) >= 0, tests))
+ tests = fnmatch.filter(tests, options.test_name_filter)
return sorted(tests)