diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-09-10 11:47:09 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-12 19:16:40 -0400 |
commit | 05303f686fae8f1050c1cfb08225e39a5f13a7a1 (patch) | |
tree | 95fd87b1daa54462c29e9f1c64c2dbbc87d33262 /testsuite/tests | |
parent | 3b1c12d353eef24b29601798874eb875978452cd (diff) | |
download | haskell-05303f686fae8f1050c1cfb08225e39a5f13a7a1.tar.gz |
testsuite: Clean up dynlib support predicates
Previously it was unclear whether req_shared_libs should require:
* that the platform supports dynamic library loading,
* that GHC supports dynamic linking of Haskell code, or
* that the dyn way libraries were built
Clarify by splitting the predicate into two:
* `req_dynamic_lib_support` demands that the platform support dynamic
linking
* `req_dynamic_hs` demands that the GHC support dynamic linking of
Haskell code on the target platform
Naturally `req_dynamic_hs` cannot be true unless
`req_dynamic_lib_support` is also true.
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/cabal/cabal01/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/cabal/cabal04/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/driver/T20348/all.T | 5 | ||||
-rw-r--r-- | testsuite/tests/driver/recompChangedPackage/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/driver/recompPluginPackage/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/driver/recompTHpackage/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/dynlibs/Makefile | 12 | ||||
-rw-r--r-- | testsuite/tests/dynlibs/T19350/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/dynlibs/all.T | 31 | ||||
-rw-r--r-- | testsuite/tests/ghci/linking/all.T | 4 | ||||
-rw-r--r-- | testsuite/tests/ghci/linking/dyn/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/profiling/should_compile/all.T | 3 | ||||
-rw-r--r-- | testsuite/tests/rts/linker/all.T | 7 | ||||
-rw-r--r-- | testsuite/tests/safeHaskell/check/pkg01/all.T | 2 |
14 files changed, 44 insertions, 34 deletions
diff --git a/testsuite/tests/cabal/cabal01/all.T b/testsuite/tests/cabal/cabal01/all.T index 9bf2eb13d5..4a17490f18 100644 --- a/testsuite/tests/cabal/cabal01/all.T +++ b/testsuite/tests/cabal/cabal01/all.T @@ -8,7 +8,7 @@ if config.have_profiling: else: prof = '--disable-library-profiling' -if config.have_shared_libs: +if config.have_dynamic: dyn = '--enable-shared' else: dyn = '--disable-shared' diff --git a/testsuite/tests/cabal/cabal04/all.T b/testsuite/tests/cabal/cabal04/all.T index 3a4756026a..d84acf98b3 100644 --- a/testsuite/tests/cabal/cabal04/all.T +++ b/testsuite/tests/cabal/cabal04/all.T @@ -8,7 +8,7 @@ if config.have_profiling: else: prof = '--disable-library-profiling' -if not config.compiler_profiled and config.have_shared_libs: +if not config.compiler_profiled and config.have_dynamic: dyn = '--enable-shared' else: dyn = '--disable-shared' diff --git a/testsuite/tests/driver/T20348/all.T b/testsuite/tests/driver/T20348/all.T index cd888b0105..935c8efa8c 100644 --- a/testsuite/tests/driver/T20348/all.T +++ b/testsuite/tests/driver/T20348/all.T @@ -1,2 +1,3 @@ -test('T20348', [extra_files(['A.hs']), - when(opsys('mingw32'), skip)], makefile_test, []) +# N.B. this package requires a dynamically-linked ghc-bin, since it assumes +# that TH evaluation will build dynamic objects. +test('T20348', [extra_files(['A.hs']), unless(have_dynamic(), skip)], makefile_test, []) diff --git a/testsuite/tests/driver/recompChangedPackage/all.T b/testsuite/tests/driver/recompChangedPackage/all.T index 8acd1655b9..f08a2534f6 100644 --- a/testsuite/tests/driver/recompChangedPackage/all.T +++ b/testsuite/tests/driver/recompChangedPackage/all.T @@ -8,7 +8,7 @@ if config.have_profiling: else: prof = '--disable-library-profiling' -if not config.compiler_profiled and config.have_shared_libs: +if not config.compiler_profiled and config.have_dynamic: dyn = '--enable-shared' else: dyn = '--disable-shared' diff --git a/testsuite/tests/driver/recompPluginPackage/all.T b/testsuite/tests/driver/recompPluginPackage/all.T index ea6cce4baa..08271d9c46 100644 --- a/testsuite/tests/driver/recompPluginPackage/all.T +++ b/testsuite/tests/driver/recompPluginPackage/all.T @@ -8,7 +8,7 @@ if config.have_profiling: else: prof = '--disable-library-profiling' -if not config.compiler_profiled and config.have_shared_libs: +if not config.compiler_profiled and config.have_dynamic: dyn = '--enable-shared' else: dyn = '--disable-shared' diff --git a/testsuite/tests/driver/recompTHpackage/all.T b/testsuite/tests/driver/recompTHpackage/all.T index 6e2826300c..78de429b70 100644 --- a/testsuite/tests/driver/recompTHpackage/all.T +++ b/testsuite/tests/driver/recompTHpackage/all.T @@ -8,7 +8,7 @@ if config.have_profiling: else: prof = '--disable-library-profiling' -if not config.compiler_profiled and config.have_shared_libs: +if not config.compiler_profiled and config.have_dynamic: dyn = '--enable-shared' else: dyn = '--disable-shared' diff --git a/testsuite/tests/dynlibs/Makefile b/testsuite/tests/dynlibs/Makefile index 19009605ea..3de7571f27 100644 --- a/testsuite/tests/dynlibs/Makefile +++ b/testsuite/tests/dynlibs/Makefile @@ -67,9 +67,9 @@ T18072: $(RM) -rf T18072/ mkdir T18072 '$(TEST_HC)' $(filter-out -rtsopts,$(TEST_HC_OPTS)) -v0 -outputdir T18072 \ - -dynamic -fPIC -c T18072.hs + -dynamic -fPIC -c T18072.hs '$(TEST_HC)' $(filter-out -rtsopts,$(TEST_HC_OPTS)) -v0 -outputdir T18072 \ - -dynamic -shared -flink-rts T18072/T18072.o -o T18072/T18072.so + -dynamic -shared -flink-rts T18072/T18072.o -o T18072/T18072.so ldd T18072/T18072.so | grep libHSrts >/dev/null .PHONY: T18072debug @@ -77,9 +77,9 @@ T18072debug: $(RM) -rf T18072debug/ mkdir T18072debug '$(TEST_HC)' $(filter-out -rtsopts,$(TEST_HC_OPTS)) -v0 -outputdir T18072debug \ - -dynamic -fPIC -c T18072.hs + -dynamic -fPIC -c T18072.hs '$(TEST_HC)' $(filter-out -rtsopts,$(TEST_HC_OPTS)) -v0 -outputdir T18072debug \ - -dynamic -shared -flink-rts -debug T18072debug/T18072.o -o T18072debug/T18072.so + -dynamic -shared -flink-rts -debug T18072debug/T18072.o -o T18072debug/T18072.so ldd T18072debug/T18072.so | grep libHSrts | grep _debug >/dev/null .PHONY: T18072static @@ -87,7 +87,7 @@ T18072static: $(RM) -rf T18072static/ mkdir T18072static '$(TEST_HC)' $(filter-out -rtsopts,$(TEST_HC_OPTS)) -v0 -outputdir T18072static \ - -c T18072.hs + -c T18072.hs '$(TEST_HC)' $(filter-out -rtsopts,$(TEST_HC_OPTS)) -v0 -outputdir T18072static \ - -staticlib -fno-link-rts T18072static/T18072.o -o T18072static/T18072.a + -staticlib -fno-link-rts T18072static/T18072.o -o T18072static/T18072.a ar t T18072static/T18072.a | grep RtsSymbols.o > /dev/null && exit 1 || exit 0 diff --git a/testsuite/tests/dynlibs/T19350/all.T b/testsuite/tests/dynlibs/T19350/all.T index c8915bde1f..19a34edfdb 100644 --- a/testsuite/tests/dynlibs/T19350/all.T +++ b/testsuite/tests/dynlibs/T19350/all.T @@ -13,4 +13,4 @@ # into libhello. # -test('T19350', [req_shared_libs, expect_broken(19350), extra_files(['clib', 'lib'])], makefile_test, []) +test('T19350', [req_dynamic_lib_support, expect_broken(19350), extra_files(['clib', 'lib'])], makefile_test, []) diff --git a/testsuite/tests/dynlibs/all.T b/testsuite/tests/dynlibs/all.T index 622bcab6a7..569962761a 100644 --- a/testsuite/tests/dynlibs/all.T +++ b/testsuite/tests/dynlibs/all.T @@ -1,24 +1,31 @@ test('T3807', - [req_shared_libs, - when(have_thread_sanitizer(), expect_broken(18883)), - when(opsys('mingw32'), - skip)], makefile_test, []) + [unless(have_dynamic(), skip), + when(have_thread_sanitizer(), expect_broken(18883))], + makefile_test, []) -test('T4464', [req_shared_libs, unless(opsys('mingw32'), skip)], makefile_test, []) +test('T4464', [req_dynamic_hs, unless(opsys('mingw32'), skip)], makefile_test, []) -test('T5373', [req_shared_libs], makefile_test, []) +test('T5373', [unless(have_dynamic(), skip)], makefile_test, []) # It's not clear exactly what platforms we can expect this to succeed on. test('T13702', [when(have_thread_sanitizer(), expect_broken(18884)), - req_shared_libs, unless(opsys('linux'), skip)], + unless(have_dynamic(), skip), + unless(opsys('linux'), skip)], makefile_test, []) -# test that -shared and -flink-rts actually links the rts -test('T18072', [req_shared_libs, unless(opsys('linux'), skip)], makefile_test, []) +# test that -shared and -flink-rts actually links the RTS +test('T18072', [unless(have_dynamic(), skip), unless(opsys('linux'), skip)], makefile_test, []) # test that -shared and -flink-rts respects alternative RTS flavours -test('T18072debug', [extra_files(['T18072.hs']), req_shared_libs, unless(opsys('linux'), skip)], makefile_test, []) +test('T18072debug', + [unless(have_dynamic(), skip), + extra_files(['T18072.hs']), + unless(opsys('linux'), skip)], + makefile_test, []) -# check that -staticlib and -fno-link-rts results in an archive without the RTR library -test('T18072static', [extra_files(['T18072.hs']), unless(opsys('linux'), skip)], makefile_test, []) +# check that -staticlib and -fno-link-rts results in an archive without the RTS library +test('T18072static', + [extra_files(['T18072.hs']), + unless(opsys('linux'), skip)], + makefile_test, []) diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T index 655941d145..574ff9308c 100644 --- a/testsuite/tests/ghci/linking/all.T +++ b/testsuite/tests/ghci/linking/all.T @@ -8,7 +8,7 @@ test('ghcilink001', test('ghcilink002', [extra_files(['TestLink.hs', 'f.c']), when(unregisterised(), fragile(16085)), unless(doing_ghci, skip), - req_shared_libs], + unless(have_dynamic(), skip)], makefile_test, ['ghcilink002']) test('ghcilink003', @@ -32,7 +32,7 @@ test('ghcilink005', [extra_files(['TestLink.hs', 'f.c']), when(unregisterised(), fragile(16085)), unless(doing_ghci, skip), - req_shared_libs], + req_dynamic_lib_support], makefile_test, ['ghcilink005']) test('ghcilink006', diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T index e2593ded9b..0092f7febe 100644 --- a/testsuite/tests/ghci/linking/dyn/all.T +++ b/testsuite/tests/ghci/linking/dyn/all.T @@ -1,4 +1,4 @@ -setTestOpts(req_shared_libs) +setTestOpts(req_dynamic_lib_support) test('load_short_name', [extra_files(['A.c']), unless(doing_ghci, skip)], diff --git a/testsuite/tests/profiling/should_compile/all.T b/testsuite/tests/profiling/should_compile/all.T index d91cf9c666..a6a6d50c7c 100644 --- a/testsuite/tests/profiling/should_compile/all.T +++ b/testsuite/tests/profiling/should_compile/all.T @@ -6,8 +6,7 @@ test('prof002', [only_ways(['normal']), req_profiling], compile_and_run, ['-prof test('T2410', [only_ways(['normal']), req_profiling], compile, ['-O2 -prof -fprof-cafs']) test('T5889', [only_ways(['normal']), req_profiling, extra_files(['T5889/A.hs', 'T5889/B.hs'])], multimod_compile, ['A B', '-O -prof -fno-prof-count-entries -v0']) test('T12790', [only_ways(['normal']), req_profiling], compile, ['-O -prof']) -# -dynamic-too not supported on Windows -test('T14931', [when(opsys('mingw32'), skip), only_ways(['normal']), req_profiling, req_shared_libs], +test('T14931', [only_ways(['normal']), req_profiling, unless(have_dynamic(), skip)], makefile_test, ['T14931']) test('T15108', [only_ways(['normal']), req_profiling], compile, ['-O -prof -fprof-auto']) test('T19894', [only_ways(['normal']), req_profiling, extra_files(['T19894'])], multimod_compile, ['Main', '-v0 -O2 -prof -fprof-auto -iT19894']) diff --git a/testsuite/tests/rts/linker/all.T b/testsuite/tests/rts/linker/all.T index 32827de494..728a592b4e 100644 --- a/testsuite/tests/rts/linker/all.T +++ b/testsuite/tests/rts/linker/all.T @@ -82,11 +82,14 @@ test('T5435_dyn_gcc', extra_files(['T5435.hs', 'T5435_gcc.c']) , makefile_test, ###################################### test('linker_unload', - [extra_files(['LinkerUnload.hs', 'Test.hs']), req_rts_linker], + [extra_files(['LinkerUnload.hs', 'Test.hs']), + req_rts_linker], makefile_test, ['linker_unload']) test('linker_unload_native', - [extra_files(['LinkerUnload.hs', 'Test.hs']), req_rts_linker, + [extra_files(['LinkerUnload.hs', 'Test.hs']), + req_rts_linker, + unless(have_dynamic(), skip), when(opsys('darwin') or opsys('mingw32'), skip)], makefile_test, ['linker_unload_native']) diff --git a/testsuite/tests/safeHaskell/check/pkg01/all.T b/testsuite/tests/safeHaskell/check/pkg01/all.T index 511c458815..fd23b2d362 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/all.T +++ b/testsuite/tests/safeHaskell/check/pkg01/all.T @@ -17,7 +17,7 @@ if config.have_profiling: else: prof = '--disable-library-profiling' -if config.have_shared_libs: +if config.have_dynamic: dyn = '--enable-shared' else: dyn = '--disable-shared' |