diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-18 19:00:15 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2016-06-20 16:22:07 +0200 |
commit | 3b49f8faa1cbd3a04f1d6aa817a315a853e0cd79 (patch) | |
tree | 5c221937ba623e310dd01365816ebdf3ee9dd682 | |
parent | 1d938aa3373f464f46dd3806a21aa85dda764ec6 (diff) | |
download | haskell-3b49f8faa1cbd3a04f1d6aa817a315a853e0cd79.tar.gz |
Testsuite: remove `-fforce-recomp` from default flags (#11980)
There is no need for this flag anymore, since each test runs in a
newly created directory. Removing it cleans up testlib.py a bit.
There is a small risk that this renders some tests useless. It's hard to
know. Those tests should have specified -fforce-recomp` explicitly
anyway, so I'm not going to worry about it. I've fixed the ones that
failed without -fforce-recomp.
Reviewed by: bgamari
Differential Revision: https://phabricator.haskell.org/D2346
-rw-r--r-- | testsuite/driver/testlib.py | 34 | ||||
-rw-r--r-- | testsuite/mk/test.mk | 2 | ||||
-rw-r--r-- | testsuite/tests/cabal/cabal08/Makefile | 2 | ||||
-rw-r--r-- | testsuite/tests/driver/Makefile | 2 | ||||
-rw-r--r-- | testsuite/tests/driver/all.T | 5 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci024.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/module/base01/Makefile | 4 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/Makefile | 4 |
8 files changed, 19 insertions, 35 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 4dce6e3e36..eaeb315719 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1007,9 +1007,7 @@ def run_command( name, way, cmd ): # GHCi tests def ghci_script( name, way, script, override_flags = None ): - # filter out -fforce-recomp from compiler_always_flags, because we're - # actually testing the recompilation behaviour in the GHCi tests. - flags = ' '.join(get_compiler_flags(override_flags, noforce=True)) + flags = ' '.join(get_compiler_flags(override_flags)) way_flags = ' '.join(config.way_flags(name)[way]) @@ -1076,10 +1074,7 @@ def do_compile( name, way, should_fail, top_mod, extra_mods, extra_hc_opts, over return result extra_hc_opts = result['hc_opts'] - force = 0 - if extra_mods: - force = 1 - result = simple_build( name, way, extra_hc_opts, should_fail, top_mod, 0, 1, force, override_flags ) + result = simple_build(name, way, extra_hc_opts, should_fail, top_mod, 0, 1, override_flags) if badResult(result): return result @@ -1103,7 +1098,7 @@ def do_compile( name, way, should_fail, top_mod, extra_mods, extra_hc_opts, over def compile_cmp_asm( name, way, extra_hc_opts ): print('Compile only, extra args = ', extra_hc_opts) - result = simple_build( name + '.cmm', way, '-keep-s-files -O ' + extra_hc_opts, 0, '', 0, 0, 0) + result = simple_build(name + '.cmm', way, '-keep-s-files -O ' + extra_hc_opts, 0, '', 0, 0) if badResult(result): return result @@ -1137,11 +1132,7 @@ def compile_and_run__( name, way, top_mod, extra_mods, extra_hc_opts ): if way.startswith('ghci'): # interpreted... return interpreter_run( name, way, extra_hc_opts, 0, top_mod ) else: # compiled... - force = 0 - if extra_mods: - force = 1 - - result = simple_build( name, way, extra_hc_opts, 0, top_mod, 1, 1, force) + result = simple_build(name, way, extra_hc_opts, 0, top_mod, 1, 1) if badResult(result): return result @@ -1222,9 +1213,8 @@ def checkStats(name, way, stats_file, range_fields): # Build a single-module program def extras_build( way, extra_mods, extra_hc_opts ): - for modopts in extra_mods: - mod, opts = modopts - result = simple_build( mod, way, opts + ' ' + extra_hc_opts, 0, '', 0, 0, 0) + for mod, opts in extra_mods: + result = simple_build(mod, way, opts + ' ' + extra_hc_opts, 0, '', 0, 0) if not (mod.endswith('.hs') or mod.endswith('.lhs')): extra_hc_opts += ' ' + replace_suffix(mod, 'o') if badResult(result): @@ -1232,8 +1222,7 @@ def extras_build( way, extra_mods, extra_hc_opts ): return {'passFail' : 'pass', 'hc_opts' : extra_hc_opts} - -def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link, addsuf, noforce, override_flags = None ): +def simple_build(name, way, extra_hc_opts, should_fail, top_mod, link, addsuf, override_flags=None): opts = getTestOpts() errname = add_suffix(name, 'comp.stderr') @@ -1273,7 +1262,7 @@ def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link, addsuf, else: cmd_prefix = getTestOpts().compile_cmd_prefix + ' ' - flags = ' '.join(get_compiler_flags(override_flags, noforce) + + flags = ' '.join(get_compiler_flags(override_flags) + config.way_flags(name)[way]) cmd = ('cd "{opts.testdir}" && {cmd_prefix} ' @@ -1448,7 +1437,7 @@ def interpreter_run( name, way, extra_hc_opts, compile_only, top_mod ): if os.path.exists(stdin_file): os.system('cat "{0}" >> "{1}"'.format(stdin_file, qscriptname)) - flags = ' '.join(get_compiler_flags(override_flags=None, noforce=False) + + flags = ' '.join(get_compiler_flags() + config.way_flags(name)[way]) if getTestOpts().combined_output: @@ -1516,7 +1505,7 @@ def split_file(in_fn, delimiter, out1_fn, out2_fn): # ----------------------------------------------------------------------------- # Utils -def get_compiler_flags(override_flags, noforce): +def get_compiler_flags(override_flags=None): opts = getTestOpts() if override_flags is not None: @@ -1524,9 +1513,6 @@ def get_compiler_flags(override_flags, noforce): else: flags = copy.copy(opts.compiler_always_flags) - if noforce: - flags = [f for f in flags if f != '-fforce-recomp'] - flags.append(opts.extra_hc_opts) if opts.outputdir != None: diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index 92dc51ffb6..2586e29ba7 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -34,7 +34,7 @@ endif # TEST_HC_OPTS is passed to every invocation of TEST_HC # in nested Makefiles -TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-$(GhcPackageDbFlag) -rtsopts $(EXTRA_HC_OPTS) +TEST_HC_OPTS = -dcore-lint -dcmm-lint -dno-debug-output -no-user-$(GhcPackageDbFlag) -rtsopts $(EXTRA_HC_OPTS) TEST_HC_OPTS_INTERACTIVE = $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci diff --git a/testsuite/tests/cabal/cabal08/Makefile b/testsuite/tests/cabal/cabal08/Makefile index 2d6ad9500c..d01578db5f 100644 --- a/testsuite/tests/cabal/cabal08/Makefile +++ b/testsuite/tests/cabal/cabal08/Makefile @@ -22,7 +22,7 @@ cabal08: clean cd p2 && $(SETUP) register '$(TEST_HC)' $(TEST_HC_OPTS) -package-db tmp1.d -package-db tmp2.d Main.hs ./Main - '$(TEST_HC)' $(TEST_HC_OPTS) -package-db tmp1.d -package-db tmp2.d -hide-all-packages -package base -package p Main.hs + '$(TEST_HC)' $(TEST_HC_OPTS) -fforce-recomp -package-db tmp1.d -package-db tmp2.d -hide-all-packages -package base -package p Main.hs ./Main ifneq "$(CLEANUP)" "" $(MAKE) -s --no-print-directory clean diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile index 41a1891377..79615f5160 100644 --- a/testsuite/tests/driver/Makefile +++ b/testsuite/tests/driver/Makefile @@ -619,7 +619,7 @@ T10320: $(RM) -rf T10320 T10320.dump-rule-rewrites T10320.hi T10320.o "$(TEST_HC)" $(TEST_HC_OPTS) -ddump-to-file -ddump-rule-rewrites -fenable-rewrite-rules T10320.hs [ -s T10320.dump-rule-rewrites ] - "$(TEST_HC)" $(TEST_HC_OPTS) -ddump-to-file -ddump-rule-rewrites T10320.hs + "$(TEST_HC)" $(TEST_HC_OPTS) -fforce-recomp -ddump-to-file -ddump-rule-rewrites T10320.hs [ -f T10320.dump-rule-rewrites ] && [ ! -s T10320.dump-rule-rewrites ] .PHONY: T12135 diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index f1522b900b..00afc1c13a 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -418,9 +418,8 @@ test('T8101', expect_broken(10600), compile, ['-Wall -fno-code']) test('T8101b', expect_broken(10600), multimod_compile, ['T8101b', '-Wall -fno-code']) -def build_T9050(name, way): - return simple_build(name + '.cmm', way, '-outputdir=. ', 0, '', 0, 0, 0) -test('T9050', normal, build_T9050, []) +# Should not panic when compiling cmm file together with -outputdir. +test('T9050', cmm_src, compile, ['-outputdir=.']) test('write_interface_oneshot', extra_clean(['write_interface_oneshot_hidir/*']), diff --git a/testsuite/tests/ghci/scripts/ghci024.stdout b/testsuite/tests/ghci/scripts/ghci024.stdout index b92adad855..2870d4c590 100644 --- a/testsuite/tests/ghci/scripts/ghci024.stdout +++ b/testsuite/tests/ghci/scripts/ghci024.stdout @@ -6,7 +6,6 @@ with the following modifiers: -XNondecreasingIndentation GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: - -fforce-recomp -fimplicit-import-qualified -fshow-warning-groups warning settings: diff --git a/testsuite/tests/module/base01/Makefile b/testsuite/tests/module/base01/Makefile index 4358f0b3e6..e1ae4f2dd7 100644 --- a/testsuite/tests/module/base01/Makefile +++ b/testsuite/tests/module/base01/Makefile @@ -9,6 +9,6 @@ clean: base01: rm -f GHC/*.o rm -f GHC/*.hi - '$(TEST_HC)' $(filter-out -fforce-recomp,$(TEST_HC_OPTS)) -XNoImplicitPrelude -this-unit-id base -c GHC/Base.hs - '$(TEST_HC)' $(filter-out -fforce-recomp,$(TEST_HC_OPTS)) -XNoImplicitPrelude -this-unit-id base --make GHC.Foo + '$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -this-unit-id base -c GHC/Base.hs + '$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -this-unit-id base --make GHC.Foo diff --git a/testsuite/tests/typecheck/should_compile/Makefile b/testsuite/tests/typecheck/should_compile/Makefile index 840254db58..54e9728b81 100644 --- a/testsuite/tests/typecheck/should_compile/Makefile +++ b/testsuite/tests/typecheck/should_compile/Makefile @@ -20,9 +20,9 @@ T2412: tc245: $(RM) -f Tc245_A.hi Tc245_A.o tc245.hi tc245.o - '$(TEST_HC)' $(filter-out -fforce-recomp,$(TEST_HC_OPTS)) --make tc245 + '$(TEST_HC)' $(TEST_HC_OPTS) --make tc245 $(RM) -f tc245.hi tc245.o - '$(TEST_HC)' $(filter-out -fforce-recomp,$(TEST_HC_OPTS)) --make tc245 + '$(TEST_HC)' $(TEST_HC_OPTS) --make tc245 # Trac #5792 gave an error on the second compilation, # presumably because of the .hi file |