[commit: testsuite] master: Add a (currently very permissive) test name check (df8b626)

Ian Lynagh igloo at earth.li
Wed Jan 23 01:17:57 CET 2013


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

On branch  : master

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

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

commit df8b626a4d6a91a21a2fee4dde26d35c2ab12dda
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 ba03eba..c265350 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -645,6 +645,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)
 
     if type(setup) is types.ListType:





More information about the ghc-commits mailing list