summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Shao <terrorjack@type.dance>2023-02-06 11:44:20 +0000
committerCheng Shao <terrorjack@type.dance>2023-03-30 18:43:53 +0000
commitf7478d9543293cd78ce81c1aa730cc3025cffe9e (patch)
tree3355479acbfdc3693c2d9496134bfc1f37ce4124
parenta984a103ce08faf907d08980fa2e58cacf3aa531 (diff)
downloadhaskell-f7478d9543293cd78ce81c1aa730cc3025cffe9e.tar.gz
testsuite: handle target executable extension
-rw-r--r--testsuite/driver/testlib.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 62be228ca9..bf0ec0b3a8 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -637,6 +637,11 @@ KNOWN_OPERATING_SYSTEMS = set([
'solaris2',
])
+def exe_extension() -> str:
+ if config.arch == 'wasm32':
+ return '.wasm'
+ return ''
+
def opsys( os: str ) -> bool:
assert os in KNOWN_OPERATING_SYSTEMS
return config.os == os
@@ -1590,7 +1595,7 @@ def compile_and_run__(name: TestName,
if badResult(result):
return result
- cmd = './' + name;
+ cmd = './' + name + exe_extension()
# we don't check the compiler's stderr for a compile-and-run test
return simple_run( name, way, cmd, getTestOpts().extra_run_opts )
@@ -2137,7 +2142,7 @@ def check_prof_ok(name: TestName, way: WayName) -> bool:
if not expected_prof_path.exists():
return True
- actual_prof_file = add_suffix(name, 'prof')
+ actual_prof_file = add_suffix(name + exe_extension(), 'prof')
actual_prof_path = in_testdir(actual_prof_file)
if not actual_prof_path.exists():