[commit: ghc] master: Normalise GHC version number to make tests less fragile. (2719526)

git at git.haskell.org git at git.haskell.org
Fri Aug 22 14:06:40 UTC 2014


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/27195265e2a9fc4451dffa44da3e2641561e74b3/ghc

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

commit 27195265e2a9fc4451dffa44da3e2641561e74b3
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Fri Aug 22 15:05:29 2014 +0100

    Normalise GHC version number to make tests less fragile.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


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

27195265e2a9fc4451dffa44da3e2641561e74b3
 testsuite/tests/package/all.T             | 9 ++++++---
 testsuite/tests/package/package06e.stderr | 4 ++--
 testsuite/tests/package/package07e.stderr | 8 ++++----
 testsuite/tests/package/package08e.stderr | 8 ++++----
 4 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/testsuite/tests/package/all.T b/testsuite/tests/package/all.T
index cb30949..f2dc9dc 100644
--- a/testsuite/tests/package/all.T
+++ b/testsuite/tests/package/all.T
@@ -7,6 +7,9 @@ incr_ghc = '-package "ghc (HsTypes as MyHsTypes, HsUtils)" '
 inc_ghc = '-package ghc '
 hide_ghc = '-hide-package ghc '
 
+def normaliseGhcVersion(str):
+    return re.sub('ghc-[0-9.]+', 'ghc-<VERSION>', str)
+
 test('package01',  normal, compile,      [hide_all + incr_containers])
 test('package01e', normal, compile_fail, [hide_all + incr_containers])
 test('package02',  normal, compile,      [hide_all + inc_containers + incr_containers])
@@ -14,8 +17,8 @@ test('package03',  normal, compile,      [hide_all + incr_containers + inc_conta
 test('package04',  normal, compile,      [incr_containers])
 test('package05',  normal, compile,      [incr_ghc + inc_ghc])
 test('package06',  normal, compile,      [incr_ghc])
-test('package06e', normal, compile_fail, [incr_ghc])
-test('package07e', normal, compile_fail, [incr_ghc + inc_ghc + hide_ghc])
-test('package08e', normal, compile_fail, [incr_ghc + hide_ghc])
+test('package06e', normalise_errmsg_fun(normaliseGhcVersion), compile_fail, [incr_ghc])
+test('package07e', normalise_errmsg_fun(normaliseGhcVersion), compile_fail, [incr_ghc + inc_ghc + hide_ghc])
+test('package08e', normalise_errmsg_fun(normaliseGhcVersion), compile_fail, [incr_ghc + hide_ghc])
 test('package09e', normal, compile_fail, ['-package "containers (Data.Map as M, Data.Set as M)"'])
 test('package10',  normal, compile,      ['-hide-all-packages -package "ghc (UniqFM as Prelude)" '])
diff --git a/testsuite/tests/package/package06e.stderr b/testsuite/tests/package/package06e.stderr
index 05894ee..1cb27e3 100644
--- a/testsuite/tests/package/package06e.stderr
+++ b/testsuite/tests/package/package06e.stderr
@@ -1,10 +1,10 @@
 
 package06e.hs:2:1:
     Failed to load interface for ‘HsTypes’
-    It is a member of the hidden package ‘ghc-7.9.20140821’.
+    It is a member of the hidden package ‘ghc-<VERSION>’.
     Use -v to see a list of the files searched for.
 
 package06e.hs:3:1:
     Failed to load interface for ‘UniqFM’
-    It is a member of the hidden package ‘ghc-7.9.20140821’.
+    It is a member of the hidden package ‘ghc-<VERSION>’.
     Use -v to see a list of the files searched for.
diff --git a/testsuite/tests/package/package07e.stderr b/testsuite/tests/package/package07e.stderr
index 40eaa06..0e4a040 100644
--- a/testsuite/tests/package/package07e.stderr
+++ b/testsuite/tests/package/package07e.stderr
@@ -2,20 +2,20 @@
 package07e.hs:2:1:
     Failed to load interface for ‘MyHsTypes’
     Perhaps you meant
-      HsTypes (needs flag -package-key ghc-7.9.20140821)
+      HsTypes (needs flag -package-key ghc-<VERSION>)
     Use -v to see a list of the files searched for.
 
 package07e.hs:3:1:
     Failed to load interface for ‘HsTypes’
-    It is a member of the hidden package ‘ghc-7.9.20140821’.
+    It is a member of the hidden package ‘ghc-<VERSION>’.
     Use -v to see a list of the files searched for.
 
 package07e.hs:4:1:
     Failed to load interface for ‘HsUtils’
-    It is a member of the hidden package ‘ghc-7.9.20140821’.
+    It is a member of the hidden package ‘ghc-<VERSION>’.
     Use -v to see a list of the files searched for.
 
 package07e.hs:5:1:
     Failed to load interface for ‘UniqFM’
-    It is a member of the hidden package ‘ghc-7.9.20140821’.
+    It is a member of the hidden package ‘ghc-<VERSION>’.
     Use -v to see a list of the files searched for.
diff --git a/testsuite/tests/package/package08e.stderr b/testsuite/tests/package/package08e.stderr
index 7b5c2a8..975b4b9 100644
--- a/testsuite/tests/package/package08e.stderr
+++ b/testsuite/tests/package/package08e.stderr
@@ -2,20 +2,20 @@
 package08e.hs:2:1:
     Failed to load interface for ‘MyHsTypes’
     Perhaps you meant
-      HsTypes (needs flag -package-key ghc-7.9.20140821)
+      HsTypes (needs flag -package-key ghc-<VERSION>)
     Use -v to see a list of the files searched for.
 
 package08e.hs:3:1:
     Failed to load interface for ‘HsTypes’
-    It is a member of the hidden package ‘ghc-7.9.20140821’.
+    It is a member of the hidden package ‘ghc-<VERSION>’.
     Use -v to see a list of the files searched for.
 
 package08e.hs:4:1:
     Failed to load interface for ‘HsUtils’
-    It is a member of the hidden package ‘ghc-7.9.20140821’.
+    It is a member of the hidden package ‘ghc-<VERSION>’.
     Use -v to see a list of the files searched for.
 
 package08e.hs:5:1:
     Failed to load interface for ‘UniqFM’
-    It is a member of the hidden package ‘ghc-7.9.20140821’.
+    It is a member of the hidden package ‘ghc-<VERSION>’.
     Use -v to see a list of the files searched for.



More information about the ghc-commits mailing list