diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2015-06-12 13:52:02 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2015-06-13 01:01:08 +0200 |
commit | 6e542a62e070b113f95908315c81d01c300d8803 (patch) | |
tree | 3b0962020555dd6b22907956d0795023df3cc886 | |
parent | 5ddd90415f307cac72d75d86da58e552b168ee30 (diff) | |
download | haskell-6e542a62e070b113f95908315c81d01c300d8803.tar.gz |
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
-rw-r--r-- | testsuite/driver/testglobals.py | 3 | ||||
-rw-r--r-- | testsuite/driver/testlib.py | 22 | ||||
-rw-r--r-- | testsuite/tests/concurrent/should_run/all.T | 8 | ||||
-rw-r--r-- | 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 4b6acfd9bf..76d26a386e 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 b277a35e59..3da01cebce 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 5288ff9811..2d3ac2e376 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 cc59a14d28..affea929d3 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, ['']) |