tc-testing: "show" action shows all selected tests
Subsystems (4)
PATCH 1/1 tc-testing: "show" action shows all selected tests
The -s "show" option takes an argument to specify which test to show. Change the option so it does not take an argument, but outputs all the tests that were selected with the other arguments.
It is still possible to output a single test, by using the -e option, but now more than one test can be displayed with one command.
--- tools/testing/selftests/tc-testing/tdc.py | 7 ++++--- tools/testing/selftests/tc-testing/tdc_helper.py | 12 +++--------- 2 files changed, 7 insertions(+), 12 deletions(-)
tools/testing/selftests/tc-testing/tdc.py +4 -3
@@ -211,8 +211,8 @@ def set_args(parser): help='Run tests from the specified file') parser.add_argument('-l', '--list', type=str, nargs='?', const="++", metavar='CATEGORY', help='List all test cases, or those only within the specified category') - parser.add_argument('-s', '--show', type=str, nargs=1, metavar='ID', dest='showID', - help='Display the test case with specified id') + parser.add_argument('-s', '--show', action='store_true', dest='showID', + help='Display the selected test cases') parser.add_argument('-e', '--execute', type=str, nargs=1, metavar='ID', help='Execute the single test case with specified ID') parser.add_argument('-i', '--id', action='store_true', dest='gen_id',
@@ -344,7 +344,8 @@ def set_operation_mode(args): ucat = get_test_categories(alltests) if args.showID: - show_test_case_by_id(alltests, args.showID[0]) + for atest in alltests: + print_test_case(atest) exit(0) if args.execute:
tools/testing/selftests/tc-testing/tdc_helper.py +3 -9
@@ -56,20 +56,14 @@ 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 (type(tcase[k]) == list): print(k + ":") print_list(tcase[k]) else: - print(k + ": " + tcase[k]) + if not ((k == 'id') or (k == 'name')): + print(k + ": " + str(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))) -
Signature · 1 line
2.15.0.rc0
Quoted 10 lines · Brenda J. Butler
The -s "show" option takes an argument to specify which test to show. Change the option so it does not take an argument, but outputs all the tests that were selected with the other arguments.
It is still possible to output a single test, by using the -e option, but now more than one test can be displayed with one command.
Signed-off-by Brenda J. Butler <[email protected]>
David Miller
maintainerFrom: "Brenda J. Butler" <[email protected]>
Date: Tue, 31 Oct 2017 14:30:16 -0400
Quoted 10 lines
The -s "show" option takes an argument to specify which test to show. Change the option so it does not take an argument, but outputs all the tests that were selected with the other arguments.
It is still possible to output a single test, by using the -e option, but now more than one test can be displayed with one command.
Signed-off-by Brenda J. Butler <[email protected]>
This does not apply cleanly to the net-next tree, I even get rejects.
A message that is not in the archive (sent off-list or not yet received): CAEj_wPSU-h7N0Mpa1JPRvroY=pvejyHRotv1vJbPgg0L-gx-iA@mail.gmail.com
Quoted 12 lines · Brenda Butler
Sorry, I will redo.
bjb
Quoted 6 lines · David Miller
From: "Brenda J. Butler" <[email protected]>
Date: Tue, 31 Oct 2017 14:30:16 -0400Quoted 2 lines
The -s "show" option takes an argument to specify which test to show. Change the option so it does not take an argument,
...
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Brenda J. Butler <[email protected]>This does not apply cleanly to the net-next tree, I even get rejects.
Sorry, I will redo properly.
bjb