[commit: testsuite] ghc-7.6: Add a (currently very permissive) test name check (dd09334)

Ian Lynagh igloo at earth.li
Thu Jan 24 20:11:51 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : ghc-7.6

http://hackage.haskell.org/trac/ghc/changeset/dd093344292f73e24e058532fe9d498f63faa4eb

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

commit dd093344292f73e24e058532fe9d498f63faa4eb
Author: Ian Lynagh <ian at well-typed.com>
Date:   Tue Jan 22 23:44:31 2013 +0000

    Add a (currently very permissive) test name check
    
    We now get a framework failure if a test name doesn't match
    ^[a-zA-Z0-9][a-zA-Z0-9._/-]*$

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

 driver/testlib.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/driver/testlib.py b/driver/testlib.py
index ed7cbf7..575b0a6 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -562,6 +562,8 @@ def test (name, setup, func, args):
     global allTestNames
     if name in allTestNames:
         framework_fail(name, 'duplicate', 'There are multiple tests with this name')
+    if not re.match('^[a-zA-Z0-9][a-zA-Z0-9._/-]*$', name):
+        framework_fail(name, 'bad_name', 'This test has an invalid name')
     myTestOpts = copy.copy(thisdir_testopts)
     allTests += [lambda : runTest(myTestOpts, name, setup, func, args)]
     allTestNames.add(name)





More information about the ghc-commits mailing list