diff options
author | Krzysztof Gogolewski <krz.gogolewski@gmail.com> | 2018-08-11 21:04:04 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krz.gogolewski@gmail.com> | 2018-08-11 21:04:04 +0200 |
commit | f27d7145414eae17a211b88908965c91b0236a0f (patch) | |
tree | 97dd78bbf8525d63e403830f72568999446d65a8 /testsuite | |
parent | b324c5624432f2c3d5b0a689fdff75a1ccc563f5 (diff) | |
download | haskell-f27d7145414eae17a211b88908965c91b0236a0f.tar.gz |
Simplify testsuite driver
Summary:
- remove clean_cmd
- framework_failures was undefined
- times_file was not used
- if_verbose_dump was called only when verbose >= 1; remove the check
- simplify normalise_whitespace
Test Plan: validate
Reviewers: bgamari, thomie
Reviewed By: thomie
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5061
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/driver/runtests.py | 2 | ||||
-rw-r--r-- | testsuite/driver/testglobals.py | 6 | ||||
-rw-r--r-- | testsuite/driver/testlib.py | 23 | ||||
-rw-r--r-- | testsuite/tests/driver/recomp015/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/driver/retc001/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/safeHaskell/safeLanguage/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/all.T | 1 |
7 files changed, 10 insertions, 26 deletions
diff --git a/testsuite/driver/runtests.py b/testsuite/driver/runtests.py index e01f67c358..ae4f32b96e 100644 --- a/testsuite/driver/runtests.py +++ b/testsuite/driver/runtests.py @@ -297,7 +297,7 @@ if config.list_broken: print('') if t.framework_failures: - print('WARNING:', len(framework_failures), 'framework failures!') + print('WARNING:', len(t.framework_failures), 'framework failures!') print('') else: # completion watcher diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index 246f26ce9a..067b7d4afc 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -43,9 +43,6 @@ class TestConfig: # with --verbose=0. self.no_print_summary = False - # File in which to save the times - self.times_file = '' - # What platform are we running on? self.platform = '' self.os = '' @@ -249,9 +246,6 @@ class TestOptions: # Command to run before the test self.pre_cmd = None - # Command to run for extra cleaning - self.clean_cmd = None - # Command wrapper: a function to apply to the command before running it self.cmd_wrapper = None diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index ef2b8dd40f..971ed40ff0 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -454,12 +454,6 @@ def _pre_cmd( name, opts, cmd ): # ---- -def clean_cmd( cmd ): - # TODO. Remove all calls to clean_cmd. - return lambda _name, _opts: None - -# ---- - def cmd_prefix( prefix ): return lambda name, opts, p=prefix: _cmd_prefix(name, opts, prefix) @@ -1222,7 +1216,7 @@ def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf, b if config.verbose >= 1 and _expect_pass(way): print('Compile failed (exit code {0}) errors were:'.format(exit_code)) actual_stderr_path = in_testdir(name, 'comp.stderr') - if_verbose_dump(1, actual_stderr_path) + dump_file(actual_stderr_path) # ToDo: if the sub-shell was killed by ^C, then exit @@ -1636,7 +1630,7 @@ def compare_outputs(way, kind, normaliser, expected_file, actual_file, def normalise_whitespace( str ): # Merge contiguous whitespace characters into a single space. - return ' '.join(w for w in str.split()) + return ' '.join(str.split()) callSite_re = re.compile(r', called at (.+):[\d]+:[\d]+ in [\w\-\.]+:') @@ -1800,13 +1794,12 @@ def if_verbose( n, s ): if config.verbose >= n: print(s) -def if_verbose_dump( n, f ): - if config.verbose >= n: - try: - with io.open(f) as file: - print(file.read()) - except Exception: - print('') +def dump_file(f): + try: + with io.open(f) as file: + print(file.read()) + except Exception: + print('') def runCmd(cmd, stdin=None, stdout=None, stderr=None, timeout_multiplier=1.0, print_output=0): timeout_prog = strip_quotes(config.timeout_prog) diff --git a/testsuite/tests/driver/recomp015/all.T b/testsuite/tests/driver/recomp015/all.T index e0b77f3cce..9399534c4e 100644 --- a/testsuite/tests/driver/recomp015/all.T +++ b/testsuite/tests/driver/recomp015/all.T @@ -2,7 +2,6 @@ test('recomp015', [extra_files(['Generate.hs']), - clean_cmd('$MAKE -s clean'), # See ticket:11022#comment:7 unless(opsys('linux') or opsys('solaris2') or opsys('openbsd'), skip), when(arch('arm'), skip), diff --git a/testsuite/tests/driver/retc001/all.T b/testsuite/tests/driver/retc001/all.T index 3f15ed1654..a5b0c827e1 100644 --- a/testsuite/tests/driver/retc001/all.T +++ b/testsuite/tests/driver/retc001/all.T @@ -1,6 +1,5 @@ test('retc001', [extra_files(['A.hs', 'B1.hs', 'B2.hs', 'C.hs']), - clean_cmd('$MAKE -s clean'), # See issue 11204, this test sometimes passes and sometimes fails on OSX when(opsys('darwin'), skip)], run_command, diff --git a/testsuite/tests/safeHaskell/safeLanguage/all.T b/testsuite/tests/safeHaskell/safeLanguage/all.T index a8a1bc0d7b..2807f738a8 100644 --- a/testsuite/tests/safeHaskell/safeLanguage/all.T +++ b/testsuite/tests/safeHaskell/safeLanguage/all.T @@ -36,6 +36,6 @@ test('SafeLang18', normal, compile, ['']) # Test building a package, that trust values are set correctly # and can be changed correctly #test('SafeRecomp01', -# clean_cmd('$MAKE -s --no-print-directory cleanSafeRecomp01'), +# normal, # run_command, ['$MAKE -s --no-print-directory safeRecomp01']) diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index d4eaf196df..95a9d990a1 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -148,7 +148,6 @@ test('T7785', only_ways(['optasm']), compile, ['-ddump-rules']) test('T7702', [extra_files(['T7702plugin']), pre_cmd('$MAKE -s --no-print-directory -C T7702plugin package.T7702 TOP={top}'), - clean_cmd('$MAKE -s --no-print-directory -C T7702plugin clean.T7702'), # we say 18mb peak allocated +/- 70% because other compiler flags have # a large effect on allocation which is hard to separate from the # allocation done by the plugin... but a regression allocates > 90mb |