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/driver | |
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/driver')
-rw-r--r-- | testsuite/driver/runtests.py | 2 | ||||
-rw-r--r-- | testsuite/driver/testglobals.py | 6 | ||||
-rw-r--r-- | testsuite/driver/testlib.py | 23 |
3 files changed, 9 insertions, 22 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) |