Commit c4259ff3 authored by thomie's avatar thomie
Browse files

Testsuite: make CLEANUP=1 the default (#9758)

Also move the `cleanup` setting from `default_testopts` to `config`. The
`cleanup` setting is the same for all tests, hence it belongs in
`config`.

Reviewed by: austin

Differential Revision: https://phabricator.haskell.org/D2148
parent b725fe0a
......@@ -81,6 +81,7 @@ if (ghc_with_llvm == 1):
config.run_ways.append('optllvm')
config.in_tree_compiler = in_tree_compiler
config.cleanup = cleanup
config.clean_only = clean_only
config.way_flags = lambda name : {
......
......@@ -207,9 +207,6 @@ class TestOptions:
# expected exit code
self.exit_code = 0
# should we clean up after ourselves?
self.cleanup = ''
# extra files to clean afterward
self.clean_files = []
......
......@@ -694,7 +694,7 @@ def test_common_work (name, opts, func, args):
if way not in do_ways:
skiptest (name,way)
if getTestOpts().cleanup != '' and (config.clean_only or do_ways != []):
if config.cleanup and (config.clean_only or do_ways):
pretest_cleanup(name)
clean([name + suff for suff in [
'', '.exe', '.exe.manifest', '.genscript',
......
......@@ -189,6 +189,14 @@ ifeq "$(SKIP_PERF_TESTS)" "YES"
RUNTEST_OPTS += --skip-perf-tests
endif
ifeq "$(CLEANUP)" "0"
RUNTEST_OPTS += -e cleanup=False
else ifeq "$(CLEANUP)" "NO"
RUNTEST_OPTS += -e cleanup=False
else
RUNTEST_OPTS += -e cleanup=True
endif
ifneq "$(CLEAN_ONLY)" ""
RUNTEST_OPTS += -e clean_only=True
else
......@@ -207,7 +215,6 @@ RUNTEST_OPTS += \
-e 'config.os="$(TargetOS_CPP)"' \
-e 'config.arch="$(TargetARCH_CPP)"' \
-e 'config.wordsize="$(WORDSIZE)"' \
-e 'default_testopts.cleanup="$(CLEANUP)"' \
-e 'config.timeout=int($(TIMEOUT)) or config.timeout' \
-e 'config.exeext="$(exeext)"' \
-e 'config.top="$(TOP_ABS)"'
......@@ -326,15 +333,15 @@ list_broken:
# From
# https://www.gnu.org/software/make/manual/html_node/Variables_002fRecursion.html:
#
# "The -j option is a special case (see Parallel Execution). If you set
# it to some numeric value ‘N’ and your operating system supports it (most
# any UNIX system will; others typically wont), the parent make and all the
# sub-makes will communicate to ensure that there are only ‘N’ jobs running
# "The '-j' option is a special case (see Parallel Execution). If you set
# it to some numeric value 'N' and your operating system supports it (most
# any UNIX system will; others typically won't), the parent make and all the
# sub-makes will communicate to ensure that there are only 'N' jobs running
# at the same time between them all."
#
# In our scenario, the user will actually see the following warning [2]:
#
# warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
# 'warning: jobserver unavailable: using -j1. Add '+' to parent make rule.'
#
# The problem is that topmake and submake don't know about eachother, since
# python is in between. To let them communicate, we have to use the '+'
......
......@@ -13,10 +13,10 @@ if config.have_shared_libs:
else:
dyn = '--disable-shared'
if default_testopts.cleanup != '':
if config.cleanup:
cleanup = 'CLEANUP=1'
else:
cleanup = ''
cleanup = 'CLEANUP=0'
def ignoreLdOutput(str):
return re.sub('Creating library file: dist.build.libHStest-1.0-ghc[0-9.]*.dll.a\n', '', str)
......
if default_testopts.cleanup != '':
if config.cleanup:
cleanup = 'CLEANUP=1'
else:
cleanup = ''
cleanup = 'CLEANUP=0'
test('cabal03',
ignore_output,
......
......@@ -13,10 +13,10 @@ if not config.compiler_profiled and config.have_shared_libs:
else:
dyn = '--disable-shared'
if default_testopts.cleanup != '':
if config.cleanup:
cleanup = 'CLEANUP=1'
else:
cleanup = ''
cleanup = 'CLEANUP=0'
test('cabal04',
normal,
......
if default_testopts.cleanup != '':
if config.cleanup:
cleanup = 'CLEANUP=1'
else:
cleanup = ''
cleanup = 'CLEANUP=0'
test('cabal05',
ignore_output,
......
if default_testopts.cleanup != '':
if config.cleanup:
cleanup = 'CLEANUP=1'
else:
cleanup = ''
cleanup = 'CLEANUP=0'
test('cabal06',
normal,
......
if default_testopts.cleanup != '':
if config.cleanup:
cleanup = 'CLEANUP=1'
else:
cleanup = ''
cleanup = 'CLEANUP=0'
test('cabal08',
normal,
......
if default_testopts.cleanup != '':
if config.cleanup:
cleanup = 'CLEANUP=1'
else:
cleanup = ''
cleanup = 'CLEANUP=0'
test('cabal09',
ignore_output,
......
if default_testopts.cleanup != '':
if config.cleanup:
cleanup = 'CLEANUP=1'
else:
cleanup = ''
cleanup = 'CLEANUP=0'
test('sigcabal01',
expect_broken(10622),
......
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