From e6416b10cc9ec0ce022f58b618cd18f83fb01b8d Mon Sep 17 00:00:00 2001 From: Cheng Shao Date: Thu, 6 Apr 2023 01:45:51 +0000 Subject: 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. --- testsuite/driver/testglobals.py | 3 +++ testsuite/driver/testlib.py | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'testsuite') 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 -- cgit v1.2.1