Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efab163b authored by Brenda J. Butler's avatar Brenda J. Butler Committed by David S. Miller
Browse files

tools: tc-testing: Add notap option



Add a command line arg to suppress tap output.  Handy in case
all the tap output is being supplied by the plugins.

Signed-off-by: default avatarBrenda J. Butler <bjb@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b33cc2ce
Loading
Loading
Loading
Loading
+23 −11
Original line number Original line Diff line number Diff line
@@ -241,12 +241,17 @@ def test_runner(pm, args, filtered_tests):
    testlist = filtered_tests
    testlist = filtered_tests
    tcount = len(testlist)
    tcount = len(testlist)
    index = 1
    index = 1
    tap = str(index) + ".." + str(tcount) + "\n"
    tap = ''
    badtest = None
    badtest = None
    stage = None
    stage = None
    emergency_exit = False
    emergency_exit = False
    emergency_exit_message = ''
    emergency_exit_message = ''


    if args.notap:
        if args.verbose:
            tap = 'notap requested:  omitting test plan\n'
    else:
        tap = str(index) + ".." + str(tcount) + "\n"
    try:
    try:
        pm.call_pre_suite(tcount, [tidx['id'] for tidx in testlist])
        pm.call_pre_suite(tcount, [tidx['id'] for tidx in testlist])
    except Exception as ee:
    except Exception as ee:
@@ -303,6 +308,7 @@ def test_runner(pm, args, filtered_tests):
    # if we failed in setup or teardown,
    # if we failed in setup or teardown,
    # fill in the remaining tests with ok-skipped
    # fill in the remaining tests with ok-skipped
    count = index
    count = index
    if not args.notap:
        tap += 'about to flush the tap output if tests need to be skipped\n'
        tap += 'about to flush the tap output if tests need to be skipped\n'
        if tcount + 1 != index:
        if tcount + 1 != index:
            for tidx in testlist[index - 1:]:
            for tidx in testlist[index - 1:]:
@@ -389,6 +395,9 @@ def set_args(parser):
    parser.add_argument(
    parser.add_argument(
        '-v', '--verbose', action='count', default=0,
        '-v', '--verbose', action='count', default=0,
        help='Show the commands that are being run')
        help='Show the commands that are being run')
    parser.add_argument(
        '-N', '--notap', action='store_true',
        help='Suppress tap results for command under test')
    parser.add_argument('-d', '--device',
    parser.add_argument('-d', '--device',
                        help='Execute the test case in flower category')
                        help='Execute the test case in flower category')
    return parser
    return parser
@@ -601,6 +610,9 @@ def set_operation_mode(pm, args):
        catresults = test_runner(pm, args, alltests)
        catresults = test_runner(pm, args, alltests)
    else:
    else:
        catresults = 'No tests found\n'
        catresults = 'No tests found\n'
    if args.notap:
        print('Tap output suppression requested\n')
    else:
        print('All test results: \n\n{}'.format(catresults))
        print('All test results: \n\n{}'.format(catresults))


def main():
def main():