From 2cfe05b256c50b9a8cea802858b292dcaed48066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 22 May 2021 09:43:56 +0200 Subject: [PATCH] extracttests; allow several check functions --- tools/extracttests.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/extracttests.py b/tools/extracttests.py index e71caf00d..16a526ad3 100755 --- a/tools/extracttests.py +++ b/tools/extracttests.py @@ -127,9 +127,11 @@ class Extract: continue # check - res = re.match('\\s+' + check_function + '\\(' + string, line) - if res is not None: - code = res.group(1) + for f in check_function: + res = re.match('\\s+' + f + '\\(' + string, line) + if res is not None: + code = res.group(1) + break # code.. if code is not None: @@ -240,7 +242,7 @@ filename = None htmldir = None codedir = None onlyTP = None -check_function = 'check.*' +check_function = ['check[A-Za-z0-9_]*'] for arg in sys.argv[1:]: if arg == '--xml': xml = True @@ -253,7 +255,7 @@ for arg in sys.argv[1:]: elif arg.endswith('.cpp'): filename = arg elif arg.startswith('--check-function='): - check_function = arg[17:] + check_function.append(arg[17:]) else: print('Invalid option: ' + arg) sys.exit(1)