Commit 942b1562 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Check for duplicate test names, and report them as framework failures

parent 60cdd53a
......@@ -412,6 +412,7 @@ def newTestDir( dir ):
# Actually doing tests
allTests = []
allTestNames = set([])
def runTest (opts, name, setup, func, args):
n = 1
......@@ -445,8 +446,12 @@ def runTest (opts, name, setup, func, args):
# setup :: TestOpts -> IO ()
def test (name, setup, func, args):
global allTests
global allTestNames
if name in allTestNames:
framework_fail(name, 'duplicate', 'There are multiple tests with this name')
myTestOpts = copy.copy(thisdir_testopts)
allTests += [lambda : runTest(myTestOpts, name, setup, func, args)]
if config.use_threads:
def test_common_thread(n, name, opts, func, args):
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