summaryrefslogtreecommitdiff
path: root/scripts/test
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/test')
-rw-r--r--scripts/test/shared.py6
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)