From 7593c2fbe4a68bf23b193461fab63456d98702c2 Mon Sep 17 00:00:00 2001 From: Thomas Miedema Date: Tue, 21 Jun 2016 12:32:04 +0200 Subject: Testsuite: report duplicate testnames when `make TEST=` --- testsuite/driver/testlib.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index d4fcf13d09..1381ccf9ec 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -619,6 +619,15 @@ def runTest (opts, name, func, args): # name :: String # setup :: TestOpts -> IO () def test (name, setup, func, args): + global aloneTests + global parallelTests + global allTestNames + global thisdir_settings + if name in allTestNames: + framework_fail(name, 'duplicate', 'There are multiple tests with this name') + if not re.match('^[0-9]*[a-zA-Z][a-zA-Z0-9._-]*$', name): + framework_fail(name, 'bad_name', 'This test has an invalid name') + if config.run_only_some_tests: if name not in config.only: return @@ -630,15 +639,6 @@ def test (name, setup, func, args): # report on any tests we couldn't find and error out. config.only.remove(name) - global aloneTests - global parallelTests - global allTestNames - global thisdir_settings - if name in allTestNames: - framework_fail(name, 'duplicate', 'There are multiple tests with this name') - if not re.match('^[0-9]*[a-zA-Z][a-zA-Z0-9._-]*$', name): - framework_fail(name, 'bad_name', 'This test has an invalid name') - # Make a deep copy of the default_testopts, as we need our own copy # of any dictionaries etc inside it. Otherwise, if one test modifies # them, all tests will see the modified version! -- cgit v1.2.1