From b1a4860a0ce59a0c10708c038567a041f3348f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 22 Sep 2017 23:23:36 +0200 Subject: [PATCH] extracttests.py: allow that only TP tests are extracted --- tools/extracttests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/extracttests.py b/tools/extracttests.py index 8cd50f42e..d146d4caf 100755 --- a/tools/extracttests.py +++ b/tools/extracttests.py @@ -165,7 +165,7 @@ def writeHtmlFile(nodes, functionName, filename, errorsOnly): if len(sys.argv) <= 1 or '--help' in sys.argv: print('Extract test cases from test file') print( - 'Syntax: extracttests.py [--html=folder] [--xml] [--code=folder] path/testfile.cpp') + 'Syntax: extracttests.py [--html=folder] [--xml] [--code=folder] [--onlyTP] path/testfile.cpp') sys.exit(0) # parse command line @@ -173,9 +173,12 @@ xml = False filename = None htmldir = None codedir = None +onlyTP = None for arg in sys.argv[1:]: if arg == '--xml': xml = True + elif arg == '--onlyTP': + onlyTP = True elif arg.startswith('--html='): htmldir = arg[7:] elif arg.startswith('--code='): @@ -284,6 +287,9 @@ if filename is not None: errors = open(codedir + 'errors.txt', 'w') for node in e.nodes: + if onlyTP and node['expected'] == '': + continue + testnum = testnum + 1 functionName = node['functionName']