diff options
author | Cheng Shao <terrorjack@type.dance> | 2023-04-06 01:45:51 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-04-27 16:00:35 -0400 |
commit | e6416b10cc9ec0ce022f58b618cd18f83fb01b8d (patch) | |
tree | 297140c838a4aba1a467ec52fe08e46c09c2f783 | |
parent | 6f511c36f9845a6e3731e658de4992bfd9806a52 (diff) | |
download | haskell-e6416b10cc9ec0ce022f58b618cd18f83fb01b8d.tar.gz |
testsuite: exclude ghci ways if no rts linker is present
This patch implements logic to automatically exclude ghci ways when
there is no rts linker. It's way better than having to annotate
individual test cases.
-rw-r--r-- | testsuite/driver/testglobals.py | 3 | ||||
-rw-r--r-- | testsuite/driver/testlib.py | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index 3984291ff8..6604036c12 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -139,6 +139,9 @@ class TestConfig: # Do we have interpreter support? self.have_interp = False + # Do we have RTS linker? + self.have_RTS_linker = False + # Does the platform support loading of dynamic shared libraries? e.g. # some musl-based environments do not. self.supports_dynamic_libs = True diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 5f3f44d035..8a9c280835 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -439,10 +439,17 @@ def only_ways( ways: List[WayName] ): # ----- +def valid_way( way: WayName ) -> bool: + if way in {'ghci', 'ghci-ext'}: + return config.have_RTS_linker + if way == 'ghci-ext-prof': + return config.have_RTS_linker and config.have_profiling + return True + def extra_ways( ways: List[WayName] ): def helper( name: TestName, opts ): _lint_ways(name, ways) - opts.extra_ways = ways + opts.extra_ways = [way for way in ways if valid_way(way)] return helper |