[commit: ghc] master: testsuite: Normalise away spurious differences in out-of-scope instances (9d9f4c9)

git at git.haskell.org git at git.haskell.org
Thu Dec 13 04:27:42 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9d9f4c9a7c04e152b40ae2db7c051cd9e0f5df61/ghc

>---------------------------------------------------------------

commit 9d9f4c9a7c04e152b40ae2db7c051cd9e0f5df61
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Dec 12 16:45:55 2018 -0500

    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.


>---------------------------------------------------------------

9d9f4c9a7c04e152b40ae2db7c051cd9e0f5df61
 testsuite/driver/testlib.py                    | 8 +++++++-
 testsuite/tests/arrows/should_compile/all.T    | 2 +-
 testsuite/tests/determinism/determ021/all.T    | 5 ++++-
 testsuite/tests/partial-sigs/should_fail/all.T | 2 +-
 testsuite/tests/typecheck/should_fail/all.T    | 4 ++--
 5 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index dca6ed1..e5de8e5 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 ace8af5..279dd10 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 9fde644..331d1f1 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 9866029..949f449 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 777d1b9..e8efeb5 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, [''])



More information about the ghc-commits mailing list