diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index 16489148564228ed026d58f9caea3bc6838e92ff..0cf89907fdcd2e2d72bf8b4dfb5e6aba358d15c8 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -182,8 +182,6 @@ class TestConfig: self.threads = 1 # An optional executable used to wrap target code execution - # When set tests which aren't marked with TestConfig.cross_okay - # are skipped. self.target_wrapper = None # tests which should be considered to be broken during this testsuite @@ -460,12 +458,6 @@ class TestOptions: # Should we copy the files of symlink the files for the test? self.copy_files = False - # Should the test be run in a cross-compiled tree? - # None: infer from test function - # True: run when --target-wrapper is set - # False: do not run in cross-compiled trees - self.cross_okay = None # type: Optional[bool] - # The extra hadrian dependencies we need for this particular test self.hadrian_deps = set(["test:ghc"]) # type: Set[str] diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index bb8f5318d0b4e3a2d0bf0a74f187df0a4247fbee..a6a1276349045dd3d3a4bef654ff7a3369e88073 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -91,8 +91,8 @@ def setLocalTestOpts(opts: TestOptions) -> None: global testopts_ctx_var testopts_ctx_var.set(opts) -def isCross() -> bool: - """ Are we testing a cross-compiler? """ +def needsTargetWrapper() -> bool: + """ Do we need to use a target wrapper? """ return config.target_wrapper is not None def isCompilerStatsTest() -> bool: @@ -240,7 +240,7 @@ def req_dynamic_hs( name, opts ): opts.expect = 'fail' def req_interp( name, opts ): - if not config.have_interp or isCross(): + if not config.have_interp or needsTargetWrapper(): opts.expect = 'fail' # skip on wasm32, otherwise they show up as unexpected passes if arch('wasm32'): @@ -346,11 +346,10 @@ def req_host_target_ghc( name, opts ): """ When testing a cross GHC, some test cases require a host GHC as well (e.g. for compiling custom Setup.hs). This is not supported yet (#23236), so for - the time being we skip them when testing cross GHCs. However, this is not - the case for the JS backend. The JS backend is a cross-compiler that - produces code that the host can run. + the time being we skip them when testing cross GHCs. However, for cross targets + which don't need a target wrapper (e.g. javascript), we can still run these testcases. """ - if isCross() and not js_arch(): + if needsTargetWrapper(): opts.skip = True has_ls_files = None @@ -1290,21 +1289,18 @@ async def test_common_work(name: TestName, opts, all_ways = [WayName('ghci'), WayName('ghci-opt')] else: all_ways = [] - if isCross(): - opts.cross_okay = False + if needsTargetWrapper(): + opts.skip = True 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 - if isCross(): - opts.cross_okay = False + if needsTargetWrapper(): + opts.skip = True else: all_ways = [WayName('normal')] - if isCross() and opts.cross_okay is False: - opts.skip = True - # A test itself can request extra ways by setting opts.extra_ways all_ways = list(OrderedDict.fromkeys(all_ways + [way for way in opts.extra_ways if way not in all_ways]))