summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-12 16:45:55 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-12 23:26:34 -0500
commit9d9f4c9a7c04e152b40ae2db7c051cd9e0f5df61 (patch)
tree2b0c9a53911c7565237de596aa19fa98606d83d7
parent14500dab3e9c24d2701c8be6f5a0fca30531ab80 (diff)
downloadhaskell-9d9f4c9a7c04e152b40ae2db7c051cd9e0f5df61.tar.gz
testsuite: Normalise away spurious differences in out-of-scope instances
This fixes a variety of testsuite failures with integer-simple of the form ``` --- typecheck/should_fail/tcfail072.run/tcfail072.stderr.normalised +++ typecheck/should_fail/tcfail072.run/tcfail072.comp.stderr.normalised @@ -12,7 +12,7 @@ -- Defined in ‘integer-<IMPL>-<VERSION>:GHC.Integer.Type’ instance Ord () -- Defined in ‘GHC.Classes’ ...plus 21 others - ...plus three instances involving out-of-scope types + ...plus two instances involving out-of-scope types (use -fprint-potential-instances to see them all) In the expression: g A In an equation for ‘g’: g (B _ _) = g A ``` In service of fixing #16043.
-rw-r--r--testsuite/driver/testlib.py8
-rw-r--r--testsuite/tests/arrows/should_compile/all.T2
-rw-r--r--testsuite/tests/determinism/determ021/all.T5
-rw-r--r--testsuite/tests/partial-sigs/should_fail/all.T2
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T4
5 files changed, 15 insertions, 6 deletions
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index dca6ed17e8..e5de8e5789 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -1739,9 +1739,15 @@ def normalise_errmsg( str ):
# collisions, so we need to normalise that to just "ghc"
str = re.sub('ghc-stage[123]', 'ghc', str)
- # Error messages simetimes contain integer implementation package
+ # Error messages sometimes contain integer implementation package
str = re.sub('integer-(gmp|simple)-[0-9.]+', 'integer-<IMPL>-<VERSION>', str)
+ # Error messages sometimes contain this blurb which can vary
+ # spuriously depending upon build configuration (e.g. based on integer
+ # backend)
+ str = re.sub('...plus [a-z]+ instances involving out-of-scope types',
+ '...plus N instances involving out-of-scope types', str)
+
# Also filter out bullet characters. This is because bullets are used to
# separate error sections, and tests shouldn't be sensitive to how the
# the division happens.
diff --git a/testsuite/tests/arrows/should_compile/all.T b/testsuite/tests/arrows/should_compile/all.T
index ace8af5360..279dd109dd 100644
--- a/testsuite/tests/arrows/should_compile/all.T
+++ b/testsuite/tests/arrows/should_compile/all.T
@@ -14,5 +14,5 @@ test('arrowpat', normal, compile, [''])
test('T3964', normal, compile, [''])
test('T5283', normal, compile, [''])
test('T5267', expect_broken(5267), compile, [''])
-test('T5022', normal, compile, [''])
+test('T5022', normalise_fun(normalise_errmsg), compile, [''])
test('T5333', normal, compile, [''])
diff --git a/testsuite/tests/determinism/determ021/all.T b/testsuite/tests/determinism/determ021/all.T
index 9fde6445e2..331d1f1a21 100644
--- a/testsuite/tests/determinism/determ021/all.T
+++ b/testsuite/tests/determinism/determ021/all.T
@@ -1 +1,4 @@
-test('determ021', [extra_files(['A.hs'])], run_command, ['$MAKE -s --no-print-directory determ021'])
+test('determ021',
+ [normalise_fun(normalise_errmsg), extra_files(['A.hs'])],
+ run_command,
+ ['$MAKE -s --no-print-directory determ021'])
diff --git a/testsuite/tests/partial-sigs/should_fail/all.T b/testsuite/tests/partial-sigs/should_fail/all.T
index 9866029e91..949f449452 100644
--- a/testsuite/tests/partial-sigs/should_fail/all.T
+++ b/testsuite/tests/partial-sigs/should_fail/all.T
@@ -57,7 +57,7 @@ test('WildcardInTypeSynonymLHS', normal, compile_fail, [''])
test('WildcardInTypeSynonymRHS', normal, compile_fail, [''])
test('T10615', normal, compile_fail, [''])
test('T10045', normal, compile_fail, [''])
-test('T10999', normal, compile_fail, [''])
+test('T10999', normalise_fun(normalise_errmsg), compile_fail, [''])
test('T11122', normal, compile, [''])
test('T11515', normal, compile_fail, [''])
test('T11976', normal, compile_fail, [''])
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 777d1b92f7..e8efeb5468 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -60,7 +60,7 @@ test('tcfail068', normal, compile_fail, [''])
test('tcfail069', normal, compile_fail, [''])
test('tcfail070', normal, compile_fail, [''])
test('tcfail071', normal, compile, [''])
-test('tcfail072', normal, compile_fail, [''])
+test('tcfail072', normalise_fun(normalise_errmsg), compile_fail, [''])
test('tcfail073', normal, compile_fail, [''])
test('tcfail075', normal, compile_fail, [''])
test('tcfail076', normal, compile_fail, [''])
@@ -250,7 +250,7 @@ test('T5051', normal, compile, [''])
test('T5236',normal,compile,[''])
test('T5246',normal,compile_fail,[''])
test('T5300',normal,compile_fail,[''])
-test('T5095',normal,compile_fail,[''])
+test('T5095',normalise_fun(normalise_errmsg),compile_fail,[''])
test('T1897a',normal,compile_fail,[''])
test('AssocTyDef01', normal, compile_fail, [''])