From a6808aa55a83f0fdeb6b177c78814543ce849356 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Mon, 16 Nov 2020 14:25:14 -0800 Subject: [PATCH] auto-t: introduce new autotest syntax Sometimes improperly written tests can end up causing future tests to fail. For faster debugging you can now add a '+' after a given autotest which will start that test and run all tests which come alphabetically after it (as if you are running a full autotest suite). Example: ./test-runner -A testWPA+ This will run testWPA, testWPA2, testWPA2-no-CCMP, testWPA2-SHA256, and testWPA2withMFP. --- tools/test-runner | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/test-runner b/tools/test-runner index 69e7fe7e..803d4da5 100755 --- a/tools/test-runner +++ b/tools/test-runner @@ -802,6 +802,7 @@ def build_test_list(args): ''' tests = [] test_root = args.testhome + '/autotests' + full_list = sorted(os.listdir(test_root)) # Run all tests if not args.auto_tests: @@ -809,15 +810,19 @@ def build_test_list(args): if args.shell: return [test_root + '/shell'] - tests = os.listdir(test_root) # Pair down any non-tests and append full path - tests = [test_root + '/' + t for t in tests if t.startswith('test')] + tests = [test_root + '/' + t for t in full_list if t.startswith('test')] else: print("Generating partial test list") for t in args.auto_tests.split(','): path = '%s/%s' % (test_root, t) - # Full test path specified - if os.path.exists(t): + if t.endswith('+'): + t = t.split('+')[0] + i = full_list.index(t) + + tests = [test_root + '/' + x for x in full_list[i:] \ + if x.startswith('test')] + elif os.path.exists(t): tests.append(t) elif os.path.exists(path): tests.append(path)