From f87c7f646c6f704b29504d63c4ab965584c4aacb Mon Sep 17 00:00:00 2001 From: "Brenda J. Butler" Date: Wed, 14 Feb 2018 14:09:19 -0500 Subject: tools: tc-testing: Command line parms Separate the functionality of the command line parameters into "selection" parameters, "action" parameters and other parameters. "Selection" parameters are for choosing which tests on which to act. "Action" parameters are for choosing what to do with the selected tests. "Other" parameters are for global effect (like "help" or "verbose"). With this commit, we add the ability to name a directory as another selection mechanism. We can accumulate a number of tests by directory, file, category, or even by test id, instead of being constrained to run all tests in one collection or just one test. Signed-off-by: Brenda J. Butler Acked-by: Lucas Bates Signed-off-by: David S. Miller --- tools/testing/selftests/tc-testing/tdc_helper.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'tools/testing/selftests/tc-testing/tdc_helper.py') diff --git a/tools/testing/selftests/tc-testing/tdc_helper.py b/tools/testing/selftests/tc-testing/tdc_helper.py index db381120a566..9f35c96c88a0 100644 --- a/tools/testing/selftests/tc-testing/tdc_helper.py +++ b/tools/testing/selftests/tc-testing/tdc_helper.py @@ -57,20 +57,11 @@ def print_sll(items): def print_test_case(tcase): """ Pretty-printing of a given test case. """ + print('\n==============\nTest {}\t{}\n'.format(tcase['id'], tcase['name'])) for k in tcase.keys(): if (isinstance(tcase[k], list)): print(k + ":") print_list(tcase[k]) else: - print(k + ": " + tcase[k]) - - -def show_test_case_by_id(testlist, caseID): - """ Find the specified test case to pretty-print. """ - if not any(d.get('id', None) == caseID for d in testlist): - print("That ID does not exist.") - exit(1) - else: - print_test_case(next((d for d in testlist if d['id'] == caseID))) - - + if not ((k == 'id') or (k == 'name')): + print(k + ": " + str(tcase[k])) -- cgit v1.2.3-59-g8ed1b