commit 6f9dd97f504cbae431420cf97301ecf9f8f26c3f
parent 07fc7905ca8176ee8b71306cae6d4f1afe224362
Author: James Prestwood <prestwoj@gmail.com>
Date: Wed, 18 Aug 2021 14:50:28 -0700
test-runner: fix subtest option
This was not working correctly and would run all subtests when only a single
was requested
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/test-runner b/tools/test-runner
@@ -1271,16 +1271,18 @@ def pre_test(ctx, test, copied):
# Prune down any subtests if needed
if ctx.args.sub_tests:
ctx.args.sub_tests = ctx.args.sub_tests.split(',')
+
+ to_run = [x.split('.')[0] for x in ctx.args.sub_tests]
pruned = []
for s in subtests:
- file = s
+ no_ext = s
# Handle <file>.<test function> format
if '.' in s:
- file = s.split('.')[0] + '.py'
+ no_ext = s.split('.')[0]
- if file == s:
- pruned.append(file)
+ if no_ext in to_run:
+ pruned.append(no_ext + '.py')
subtests = pruned