Commit 7593c2fb authored by thomie's avatar thomie

Testsuite: report duplicate testnames when `make TEST=<name>`

parent bbf0aa27
......@@ -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!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment