summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-16 10:43:11 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-17 01:03:11 -0400
commitb15a7fb8aa022bfdf3286d65227061c19a4acf28 (patch)
tree95e8f4dcf22302e6ed14ab8a98eabd6ea41505af
parent42ebc3f67c8def0f941792b51bd27270ec8e8d88 (diff)
downloadhaskell-b15a7fb8aa022bfdf3286d65227061c19a4acf28.tar.gz
testsuite: Ensure that makefile tests get run
Previously `makefile_test` and `run_command` tests could easily end up in a situation where they wouldn't be run if the user used the `only_ways` modifier. The reason is to build the set of a ways to run the test in we first start with a candidate set determined by the test type (e.g. `makefile_test`, `compile_run`, etc.) and then filter that set with the constraints given by the test's modifiers. `makefile_test` and `run_command` tests' candidate sets were simply `{normal}`, and consequently most uses of `only_ways` would result in the test being never run. To avoid this we rather use all ways as the candidate sets for these test types. This may result in a few more testcases than we would like (given that some `run_command` tests are insensitive to way) but this can be fixed by adding modifiers and we would much rather run too many tests than too few. This fixes #16042 and a number of other tests afflicted by the same issue. However, there were a few cases that required special attention: * `T14028` is currently failing and is therefore marked as broken due to #17300 * `T-signals-child` is fragile in the `threaded1` and `threaded2` ways (tracked in #17307)
-rw-r--r--testsuite/driver/testlib.py5
-rw-r--r--testsuite/tests/llvm/should_run/subsections_via_symbols/Makefile4
-rw-r--r--testsuite/tests/llvm/should_run/subsections_via_symbols/all.T17
-rw-r--r--testsuite/tests/plugins/all.T2
-rw-r--r--testsuite/tests/plugins/plugin-recomp-impure.stdout2
-rw-r--r--testsuite/tests/quasiquotation/all.T4
-rw-r--r--testsuite/tests/runghc/T-signals-child.hs2
-rw-r--r--testsuite/tests/runghc/all.T1
-rw-r--r--testsuite/tests/simplCore/should_compile/T7995.stdout2
-rw-r--r--testsuite/tests/stranal/should_compile/T13031.stdout4
-rw-r--r--testsuite/tests/stranal/should_compile/T16029.stdout2
11 files changed, 24 insertions, 21 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 36aaf38076..7fe0630094 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -829,6 +829,11 @@ def test_common_work(watcher: testutil.Watcher,
all_ways = [WayName('ghci')]
else:
all_ways = []
+ elif func in [makefile_test, run_command]:
+ # makefile tests aren't necessarily runtime or compile-time
+ # specific. Assume we can run them in all ways. See #16042 for what
+ # happened previously.
+ all_ways = config.compile_ways + config.run_ways
else:
all_ways = [WayName('normal')]
diff --git a/testsuite/tests/llvm/should_run/subsections_via_symbols/Makefile b/testsuite/tests/llvm/should_run/subsections_via_symbols/Makefile
index c108a37d98..ab81b8ceb5 100644
--- a/testsuite/tests/llvm/should_run/subsections_via_symbols/Makefile
+++ b/testsuite/tests/llvm/should_run/subsections_via_symbols/Makefile
@@ -6,8 +6,8 @@ include $(TOP)/mk/test.mk
HCFLAGS = -O2 -fllvm
HCINC = $(TOP)/../includes
-.PHONY: subsections_via_symbols_test
-subsections_via_symbols_test:
+.PHONY: subsections_via_symbols
+subsections_via_symbols:
'$(TEST_HC)' -o SubsectionsViaSymbols.o SubsectionsViaSymbols.hs $(HCFLAGS) -staticlib
'$(TEST_HC)' -o subsections_via_symbols SubsectionsViaSymbols subsections_via_symbols.m $(HCFLAGS) -optl -dead_strip -no-hs-main
./subsections_via_symbols
diff --git a/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T b/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T
index 68ade25e99..16a30e6f0f 100644
--- a/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T
+++ b/testsuite/tests/llvm/should_run/subsections_via_symbols/all.T
@@ -1,16 +1,11 @@
-if config.os == 'darwin':
- only_darwin = normal
-else:
- only_darwin = skip
-
-def f( name, opts ):
- opts.only_ways = ['optllvm', 'llvm', 'debugllvm']
-
-setTestOpts(f)
-
# Note [_ffi_call_unix64]
+# ~~~~~~~~~~~~~~~~~~~~~~~
#
# Please refer to https://gitlab.haskell.org/ghc/ghc/issues/5019
# for the subsections_via_symbols.stderr
-test('subsections_via_symbols', [only_darwin], makefile_test, [])
+test('subsections_via_symbols',
+ [when(not opsys('darwin'), skip),
+ only_ways(['optllvm', 'llvm', 'debugllvm']),
+ extra_files(['SubsectionsViaSymbols.hs'])],
+ makefile_test, [])
diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T
index acc796808c..4ca732e3f5 100644
--- a/testsuite/tests/plugins/all.T
+++ b/testsuite/tests/plugins/all.T
@@ -167,6 +167,7 @@ test('plugin-recomp-flags',
test('plugin-recomp-change',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
only_ways([config.ghc_plugin_way]),
+ when(compiler_debugged(), expect_broken_for(17308, ['dyn'])),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}')
],
makefile_test, [])
@@ -174,6 +175,7 @@ test('plugin-recomp-change',
test('plugin-recomp-change-prof',
[extra_files(['plugin-recomp/', 'plugin-recomp-test.hs']),
only_ways([config.ghc_plugin_way]),
+ when(compiler_debugged(), expect_broken_for(17308, ['dyn'])),
pre_cmd('$MAKE -s --no-print-directory -C plugin-recomp package.plugins01 TOP={top}'),
when(not config.have_profiling,skip)
],
diff --git a/testsuite/tests/plugins/plugin-recomp-impure.stdout b/testsuite/tests/plugins/plugin-recomp-impure.stdout
index d282cfea8f..4a2c0aded6 100644
--- a/testsuite/tests/plugins/plugin-recomp-impure.stdout
+++ b/testsuite/tests/plugins/plugin-recomp-impure.stdout
@@ -1,4 +1,4 @@
[1 of 1] Compiling Main ( plugin-recomp-test.hs, plugin-recomp-test.o )
Linking plugin-recomp-test ...
-[1 of 1] Compiling Main ( plugin-recomp-test.hs, plugin-recomp-test.o ) [Plugin forced recompilation]
+[1 of 1] Compiling Main ( plugin-recomp-test.hs, plugin-recomp-test.o ) [Impure plugin forced recompilation]
Linking plugin-recomp-test ...
diff --git a/testsuite/tests/quasiquotation/all.T b/testsuite/tests/quasiquotation/all.T
index a48b0f102f..e8320a9f9a 100644
--- a/testsuite/tests/quasiquotation/all.T
+++ b/testsuite/tests/quasiquotation/all.T
@@ -6,5 +6,7 @@ test('T7918',
only_ways([config.ghc_th_way]), unless(have_dynamic(), skip)],
compile_and_run, ['-package ghc ' + config.ghc_th_way_flags])
test('T14028',
- [req_interp, only_ways([config.ghc_th_way])],
+ [req_interp,
+ only_ways([config.ghc_th_way]),
+ when(opsys('linux') and arch('x86_64'), expect_broken_for(17300, ['dyn']))],
makefile_test, ['T14028'])
diff --git a/testsuite/tests/runghc/T-signals-child.hs b/testsuite/tests/runghc/T-signals-child.hs
index ee36f62121..ddc21278fc 100644
--- a/testsuite/tests/runghc/T-signals-child.hs
+++ b/testsuite/tests/runghc/T-signals-child.hs
@@ -21,7 +21,7 @@ main = do
runParent :: FilePath -> IO ()
runParent runghc = do
- (Just inH, Just outH, Nothing, ph@(ProcessHandle mvar _)) <-
+ (Just inH, Just outH, Nothing, ph@(ProcessHandle mvar _ _)) <-
createProcess (proc runghc ["T-signals-child.hs", "child"])
{ std_in = CreatePipe
, std_out = CreatePipe
diff --git a/testsuite/tests/runghc/all.T b/testsuite/tests/runghc/all.T
index 1e159ee685..6747e02138 100644
--- a/testsuite/tests/runghc/all.T
+++ b/testsuite/tests/runghc/all.T
@@ -12,5 +12,6 @@ test('T17171b', req_interp, makefile_test, [])
test('T-signals-child',
[ when(opsys('mingw32'), skip), req_interp
, only_ways(['threaded1', 'threaded2'])
+ , fragile_for(17307, ['threaded1', 'threaded2'])
],
makefile_test, [])
diff --git a/testsuite/tests/simplCore/should_compile/T7995.stdout b/testsuite/tests/simplCore/should_compile/T7995.stdout
index 899ddff441..ee40d8798a 100644
--- a/testsuite/tests/simplCore/should_compile/T7995.stdout
+++ b/testsuite/tests/simplCore/should_compile/T7995.stdout
@@ -1 +1 @@
-Rule fired: text/str
+Rule fired: text/str (Pretty)
diff --git a/testsuite/tests/stranal/should_compile/T13031.stdout b/testsuite/tests/stranal/should_compile/T13031.stdout
index b6b9f61458..22ef963cea 100644
--- a/testsuite/tests/stranal/should_compile/T13031.stdout
+++ b/testsuite/tests/stranal/should_compile/T13031.stdout
@@ -1,4 +1,2 @@
-echo hello
hello
-'/5playpen/simonpj/HEAD-4/inplace/test spaces/ghc-stage2' -dcore-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -dno-debug-output -c -fforce-recomp T13031.hs -ddump-simpl | grep 'Arity='
-[GblId, Arity=1, Caf=NoCafRefs]
+[GblId, Arity=1, Caf=NoCafRefs, Unf=OtherCon []]
diff --git a/testsuite/tests/stranal/should_compile/T16029.stdout b/testsuite/tests/stranal/should_compile/T16029.stdout
index c06ac7c8b3..5aae1ff281 100644
--- a/testsuite/tests/stranal/should_compile/T16029.stdout
+++ b/testsuite/tests/stranal/should_compile/T16029.stdout
@@ -1,4 +1,4 @@
-T16029.$WMkT [InlPrag=INLINE[2]] :: Int -> Int -> T
+T16029.$WMkT [InlPrag=INLINE[0]] :: Int -> Int -> T
Tmpl= \ (dt [Occ=Once!] :: Int) (dt [Occ=Once!] :: Int) ->
= \ (dt [Occ=Once!] :: Int) (dt [Occ=Once!] :: Int) ->
:: GHC.Prim.Int# -> GHC.Prim.Int#