summaryrefslogtreecommitdiff
path: root/testsuite/tests/llvm
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 /testsuite/tests/llvm
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)
Diffstat (limited to 'testsuite/tests/llvm')
-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
2 files changed, 8 insertions, 13 deletions
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, [])