diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2020-08-20 15:38:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 15:38:07 -0700 |
commit | 47b6dd223d0e8c98f8b4261302c8c5752e59b8a4 (patch) | |
tree | 61721ebc52b94b17263151bb056bb57d5d4a21e3 | |
parent | 70e855b30114853b86f0947f49cb5a77ddad6aa9 (diff) | |
download | binaryen-47b6dd223d0e8c98f8b4261302c8c5752e59b8a4.tar.gz binaryen-47b6dd223d0e8c98f8b4261302c8c5752e59b8a4.tar.bz2 binaryen-47b6dd223d0e8c98f8b4261302c8c5752e59b8a4.zip |
Test-runner can filter tests by name (#3067)
-rw-r--r-- | scripts/test/shared.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/test/shared.py b/scripts/test/shared.py index b0cd72d17..2efa44873 100644 --- a/scripts/test/shared.py +++ b/scripts/test/shared.py @@ -81,6 +81,10 @@ def parse_args(args): parser.add_argument( '--list-suites', action='store_true', help='List the test suites that can be run.') + parser.add_argument( + '--filter', dest='test_name_filter', default='', + help=('Specifies a filter. Only tests whose paths contains this ' + 'substring will be run')) return parser.parse_args(args) @@ -362,6 +366,8 @@ def get_tests(test_dir, extensions=[]): tests += glob.glob(os.path.join(test_dir, '*')) 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)) return sorted(tests) |