[commit: ghc] master: Testsuite: add function compile_timeout_multiplier (#10345) (6e542a6)

git at git.haskell.org git at git.haskell.org
Fri Jun 12 23:01:34 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6e542a62e070b113f95908315c81d01c300d8803/ghc

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

commit 6e542a62e070b113f95908315c81d01c300d8803
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Fri Jun 12 13:52:02 2015 +0200

    Testsuite: add function compile_timeout_multiplier (#10345)
    
    And rename timeout_multiplier to run_timeout_multiplier.
    
    timeout_multiplier was added in commit
    a00389794b839971c7d52ead9e8570bfaa25ac55. The name suggested that it
    would affect any test, but it actually only affected tests that had a
    run component, and only that run component (as needed by test T367).
    
    Differential Revision: https://phabricator.haskell.org/D982


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

6e542a62e070b113f95908315c81d01c300d8803
 testsuite/driver/testglobals.py             |  3 ++-
 testsuite/driver/testlib.py                 | 22 +++++++++++++++-------
 testsuite/tests/concurrent/should_run/all.T |  8 ++++++--
 testsuite/tests/parser/should_fail/all.T    |  3 ++-
 4 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py
index 4b6acfd..76d26a3 100644
--- a/testsuite/driver/testglobals.py
+++ b/testsuite/driver/testglobals.py
@@ -278,7 +278,8 @@ class TestOptions:
        self.combined_output = False
 
        # How should the timeout be adjusted on this test?
-       self.timeout_multiplier = 1.0
+       self.compile_timeout_multiplier = 1.0
+       self.run_timeout_multiplier = 1.0
 
 # The default set of options
 global default_testopts
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index b277a35..3da01ce 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -249,11 +249,17 @@ def signal_exit_code( val ):
 
 # -----
 
-def timeout_multiplier( val ):
-    return lambda name, opts, v=val: _timeout_multiplier(name, opts, v)
+def compile_timeout_multiplier( val ):
+    return lambda name, opts, v=val: _compile_timeout_multiplier(name, opts, v)
 
-def _timeout_multiplier( name, opts, v ):
-    opts.timeout_multiplier = v
+def _compile_timeout_multiplier( name, opts, v ):
+    opts.compile_timeout_multiplier = v
+
+def run_timeout_multiplier( val ):
+    return lambda name, opts, v=val: _run_timeout_multiplier(name, opts, v)
+
+def _run_timeout_multiplier( name, opts, v ):
+    opts.run_timeout_multiplier = v
 
 # -----
 
@@ -1256,7 +1262,7 @@ def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link, addsuf,
            '> {errname} 2>&1'
           ).format(**locals())
 
-    result = runCmdFor(name, cmd)
+    result = runCmdFor(name, cmd, timeout_multiplier=opts.compile_timeout_multiplier)
 
     if result != 0 and not should_fail:
         actual_stderr = qualify(name, 'comp.stderr')
@@ -1338,7 +1344,7 @@ def simple_run( name, way, prog, args ):
     cmd = 'cd ' + opts.testdir + ' && ' + cmd
 
     # run the command
-    result = runCmdFor(name, cmd, timeout_multiplier=opts.timeout_multiplier)
+    result = runCmdFor(name, cmd, timeout_multiplier=opts.run_timeout_multiplier)
 
     exit_code = result >> 8
     signal    = result & 0xff
@@ -1384,6 +1390,8 @@ def rts_flags(way):
 # Run a program in the interpreter and check its output
 
 def interpreter_run( name, way, extra_hc_opts, compile_only, top_mod ):
+    opts = getTestOpts()
+
     outname = add_suffix(name, 'interp.stdout')
     errname = add_suffix(name, 'interp.stderr')
     rm_no_fail(outname)
@@ -1449,7 +1457,7 @@ def interpreter_run( name, way, extra_hc_opts, compile_only, top_mod ):
 
     cmd = 'cd ' + getTestOpts().testdir + " && " + cmd
 
-    result = runCmdFor(name, cmd, timeout_multiplier=getTestOpts().timeout_multiplier)
+    result = runCmdFor(name, cmd, timeout_multiplier=opts.run_timeout_multiplier)
 
     exit_code = result >> 8
     signal    = result & 0xff
diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T
index 5288ff9..2d3ac2e 100644
--- a/testsuite/tests/concurrent/should_run/all.T
+++ b/testsuite/tests/concurrent/should_run/all.T
@@ -22,8 +22,12 @@ test('conc072', only_ways(['threaded2']), compile_and_run, [''])
 test('conc073', normal, compile_and_run, [''])
 
 # vector code must get inlined to become non-allocating
-test('T367', [reqlib('vector'), omit_ways(['ghci']), timeout_multiplier(0.001)], compile_and_run, ['-O2 -fno-omit-yields'])
-test('T367_letnoescape', [timeout_multiplier(0.02), expect_broken_for(7297,['optllvm'])], compile_and_run, ['-fno-omit-yields'])
+test('T367',
+     [reqlib('vector'), omit_ways(['ghci']), run_timeout_multiplier(0.001)],
+     compile_and_run, ['-O2 -fno-omit-yields'])
+test('T367_letnoescape',
+     [run_timeout_multiplier(0.02), expect_broken_for(7297,['optllvm'])],
+     compile_and_run, ['-fno-omit-yields'])
 
 test('T1980', normal, compile_and_run, [''])
 test('T2910', normal, compile_and_run, [''])
diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T
index cc59a14..affea92 100644
--- a/testsuite/tests/parser/should_fail/all.T
+++ b/testsuite/tests/parser/should_fail/all.T
@@ -84,6 +84,7 @@ test('T984', normal, compile_fail, [''])
 test('T7848', normal, compile_fail, ['-dppr-user-length=100'])
 test('ExportCommaComma', normal, compile_fail, [''])
 test('T8430', literate, compile_fail, [''])
-test('T8431', [timeout_multiplier(0.05)], compile_fail, ['-XAlternativeLayoutRule'])
+test('T8431', compile_timeout_multiplier(0.05),
+     compile_fail, ['-XAlternativeLayoutRule'])
 test('T8506', normal, compile_fail, [''])
 test('T9225', normal, compile_fail, [''])



More information about the ghc-commits mailing list