summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-06-21 12:32:04 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2016-06-27 18:45:16 +0200
commit7593c2fbe4a68bf23b193461fab63456d98702c2 (patch)
treecce704dea470392bb4d41b561adb2f126fdd9c9f
parentbbf0aa27281d905ac8767fcbc7a26f1bfa38a1b2 (diff)
downloadhaskell-7593c2fbe4a68bf23b193461fab63456d98702c2.tar.gz
Testsuite: report duplicate testnames when `make TEST=<name>`
-rw-r--r--testsuite/driver/testlib.py18
1 files 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!