Commit f27d7145 authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski

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
parent b324c562
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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),
......
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,
......
......@@ -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'])
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment