summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorCheng Shao <terrorjack@type.dance>2023-04-09 22:25:03 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-04-27 16:00:35 -0400
commitb5f00811257670b2a9fc7904bc775f25fea3cf5b (patch)
treeb0492e8207f1539ddb35d73f3dd357e2ab4a8ad4 /testsuite
parent533d075e722c020b690e81dad61168697c3eee84 (diff)
downloadhaskell-b5f00811257670b2a9fc7904bc775f25fea3cf5b.tar.gz
testsuite: fix cross prefix stripping
This patch fixes cross prefix stripping in the testsuite driver. The normalization logic used to only handle prefixes of the triple form <arch>-<vendor>-<os>, now it's relaxed to allow any number of tokens in the prefix tuple, so the cross prefix stripping logic would work when ghc is configured with something like --target=wasm32-wasi.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/driver/testlib.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 6fa0a58455..d7d7d2251c 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -2378,21 +2378,22 @@ def normalise_errmsg(s: str) -> str:
# normalise slashes, minimise Windows/Unix filename differences
s = re.sub('\\\\', '/', s)
+ # hpc executable is given ghc suffix
+ s = re.sub('hpc-ghc', 'hpc', s)
+
# The inplace ghc's are called ghc-stage[123] to avoid filename
# collisions, so we need to normalise that to just "ghc"
s = re.sub('ghc-stage[123]', 'ghc', s)
# Remove platform prefix (e.g. javascript-unknown-ghcjs) for cross-compiled tools
# (ghc, ghc-pkg, unlit, etc.)
- s = re.sub('\\w+-\\w+-\\w+-ghc', 'ghc', s)
- s = re.sub('\\w+-\\w+-\\w+-unlit', 'unlit', s)
+ s = re.sub('\\w+(-\\w+)*-ghc', 'ghc', s)
+ s = re.sub('\\w+(-\\w+)*-unlit', 'unlit', s)
# On windows error messages can mention versioned executables
s = re.sub('ghc-[0-9.]+', 'ghc', s)
s = re.sub('runghc-[0-9.]+', 'runghc', s)
s = re.sub('hpc-[0-9.]+', 'hpc', s)
s = re.sub('ghc-pkg-[0-9.]+', 'ghc-pkg', s)
- # hpc executable is given ghc suffix
- s = re.sub('hpc-ghc', 'hpc', s)
# Error messages sometimes contain ghc-bignum implementation package
s = re.sub('ghc-bignum-[0-9.]+', 'ghc-bignum-<VERSION>', s)
@@ -2435,9 +2436,6 @@ def normalise_errmsg(s: str) -> str:
# clang may warn about unused argument when used as assembler
s = re.sub('.*warning: argument unused during compilation:.*\n', '', s)
- # strip the cross prefix if any
- s = re.sub('^([^:]+-)?ghc:', 'ghc:', s)
-
return s
# normalise a .prof file, so that we can reasonably compare it against
@@ -2531,7 +2529,7 @@ def normalise_output( s: str ) -> str:
s = re.sub('.*warning: argument unused during compilation:.*\n', '', s)
# strip the cross prefix if any
- s = re.sub('^([^:]+-)?ghc:', 'ghc:', s)
+ s = re.sub('\\w+(-\\w+)*-ghc', 'ghc', s)
return s