3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

test-runner: fix subtest option

This was not working correctly and would run all subtests when only a single
was requested
This commit is contained in:
James Prestwood 2021-08-18 14:50:28 -07:00 committed by Denis Kenzior
parent 07fc7905ca
commit 6f9dd97f50

View File

@ -1271,16 +1271,18 @@ def pre_test(ctx, test, copied):
# Prune down any subtests if needed # Prune down any subtests if needed
if ctx.args.sub_tests: if ctx.args.sub_tests:
ctx.args.sub_tests = ctx.args.sub_tests.split(',') ctx.args.sub_tests = ctx.args.sub_tests.split(',')
to_run = [x.split('.')[0] for x in ctx.args.sub_tests]
pruned = [] pruned = []
for s in subtests: for s in subtests:
file = s no_ext = s
# Handle <file>.<test function> format # Handle <file>.<test function> format
if '.' in s: if '.' in s:
file = s.split('.')[0] + '.py' no_ext = s.split('.')[0]
if file == s: if no_ext in to_run:
pruned.append(file) pruned.append(no_ext + '.py')
subtests = pruned subtests = pruned