[commit: ghc] master: Testsuite: report duplicate testnames when `make TEST=<name>` (7593c2f)

git at git.haskell.org git at git.haskell.org
Tue Jun 28 12:21:32 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/7593c2fbe4a68bf23b193461fab63456d98702c2/ghc

>---------------------------------------------------------------

commit 7593c2fbe4a68bf23b193461fab63456d98702c2
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Tue Jun 21 12:32:04 2016 +0200

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


>---------------------------------------------------------------

7593c2fbe4a68bf23b193461fab63456d98702c2
 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 d4fcf13..1381ccf 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!



More information about the ghc-commits mailing list