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

test-runner: only include comitted tests for full test runs

If specific tests are not specified with -A, only run tests tracked by
git for full test runs.
This commit is contained in:
James Prestwood 2022-01-04 09:37:35 -08:00 committed by Denis Kenzior
parent 4ee44ee0ea
commit d6d481210e

View File

@ -1100,7 +1100,6 @@ def build_test_list(args):
''' '''
tests = [] tests = []
test_root = args.testhome + '/autotests' test_root = args.testhome + '/autotests'
full_list = sorted(os.listdir(test_root))
# Run all tests # Run all tests
if not args.auto_tests: if not args.auto_tests:
@ -1108,10 +1107,16 @@ def build_test_list(args):
if args.shell: if args.shell:
return [test_root + '/shell'] return [test_root + '/shell']
# Pair down any non-tests and append full path # Get list of all autotests (committed in git)
tests = [test_root + '/' + t for t in full_list if t.startswith('test')] tests = os.popen('git -C %s ls-files autotests/ | cut -f2 -d"/" \
| grep "test*" | uniq' % args.testhome).read() \
.strip().split('\n')
tests = [test_root + '/' + t for t in tests]
else: else:
print("Generating partial test list") print("Generating partial test list")
full_list = sorted(os.listdir(test_root))
for t in args.auto_tests.split(','): for t in args.auto_tests.split(','):
path = '%s/%s' % (test_root, t) path = '%s/%s' % (test_root, t)
if t.endswith('+'): if t.endswith('+'):