[commit: ghc] master: Normalise package key hash to make tests less fragile. (aa2ceba)

git at git.haskell.org git at git.haskell.org
Tue Oct 28 01:16:51 UTC 2014


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

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

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

commit aa2ceba33a8b98a2e8020464684f2eef7c98acf1
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Mon Oct 27 17:52:39 2014 -0700

    Normalise package key hash to make tests less fragile.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>


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

aa2ceba33a8b98a2e8020464684f2eef7c98acf1
 testsuite/tests/ghci/scripts/T5979.stderr                | 6 +++---
 testsuite/tests/ghci/scripts/all.T                       | 9 ++++++++-
 testsuite/tests/safeHaskell/check/pkg01/all.T            | 6 +++++-
 testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout | 6 +++---
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/testsuite/tests/ghci/scripts/T5979.stderr b/testsuite/tests/ghci/scripts/T5979.stderr
index c2869b0..c8fc7c2 100644
--- a/testsuite/tests/ghci/scripts/T5979.stderr
+++ b/testsuite/tests/ghci/scripts/T5979.stderr
@@ -2,6 +2,6 @@
 <no location info>:
     Could not find module ‘Control.Monad.Trans.State’
     Perhaps you meant
-      Control.Monad.Trans.State (from transformers-0.4.1.0 at trans_5jw4w9yTgmZ89ByuixDAKP)
-      Control.Monad.Trans.Class (from transformers-0.4.1.0 at trans_5jw4w9yTgmZ89ByuixDAKP)
-      Control.Monad.Trans.Cont (from transformers-0.4.1.0 at trans_5jw4w9yTgmZ89ByuixDAKP)
+      Control.Monad.Trans.State (from transformers-0.4.1.0 at trans_<HASH>)
+      Control.Monad.Trans.Class (from transformers-0.4.1.0 at trans_<HASH>)
+      Control.Monad.Trans.Cont (from transformers-0.4.1.0 at trans_<HASH>)
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index 1c8adeb..ede9807 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -1,5 +1,8 @@
 # coding=utf8
 
+def normaliseTransformersPackageKey(str):
+    return re.sub('trans_[A-Za-z0-9]+', 'trans_<HASH>', str)
+
 setTestOpts(when(compiler_profiled(), skip))
 
 test('ghci001', combined_output, ghci_script, ['ghci001.script'])
@@ -114,7 +117,11 @@ test('T5564', normal, ghci_script, ['T5564.script'])
 test('Defer02', normal, ghci_script, ['Defer02.script'])
 test('T5820', normal, ghci_script, ['T5820.script'])
 test('T5836', normal, ghci_script, ['T5836.script'])
-test('T5979', [reqlib('transformers'), normalise_slashes], ghci_script, ['T5979.script'])
+test('T5979',
+    [reqlib('transformers'),
+     normalise_slashes,
+     normalise_errmsg_fun(normaliseTransformersPackageKey)],
+    ghci_script, ['T5979.script'])
 test('T5975a',
      [pre_cmd('touch föøbàr1.hs'),
       clean_cmd('rm föøbàr1.hs')],
diff --git a/testsuite/tests/safeHaskell/check/pkg01/all.T b/testsuite/tests/safeHaskell/check/pkg01/all.T
index 08f0b61..8b33f27 100644
--- a/testsuite/tests/safeHaskell/check/pkg01/all.T
+++ b/testsuite/tests/safeHaskell/check/pkg01/all.T
@@ -8,6 +8,9 @@ def normaliseArrayPackage(str):
 def normaliseBytestringPackage(str):
     return re.sub('bytestring-[0-9]+(\.[0-9]+)*', 'bytestring-<VERSION>', str)
 
+def normaliseArrayPackageKey(str):
+    return re.sub('array_[A-Za-z0-9]+', 'array_<HASH>', str)
+
 def ignoreLdOutput(str):
     return re.sub('Creating library file: pdb.safePkg01/dist.build.libHSsafePkg01-1.0-ghc[0-9.]*.dll.a\n', '', str)
 
@@ -35,7 +38,8 @@ make_args = 'VANILLA=' + vanilla + ' PROF=' + prof + ' DYN=' + dyn
 test('safePkg01',
      [clean_cmd('$MAKE -s --no-print-directory cleanPackageDatabase.safePkg01'),
       normalise_errmsg_fun(ignoreLdOutput),
-      normalise_fun(two_normalisers(normaliseArrayPackage,
+      normalise_fun(two_normalisers(two_normalisers(normaliseArrayPackage,
+                                                    normaliseArrayPackageKey),
                                     normaliseBytestringPackage))],
      run_command, 
      ['$MAKE -s --no-print-directory safePkg01 ' + make_args])
diff --git a/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout b/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout
index 7ce7704..62074de 100644
--- a/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout
+++ b/testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout
@@ -29,17 +29,17 @@ trusted: safe
 require own pkg trusted: True
 
 M_SafePkg6
-package dependencies: array-0.5.0.1 at array_GX4NwjS8xZkC2ZPtjgwhnz
+package dependencies: array-0.5.0.1 at array_<HASH>
 trusted: trustworthy
 require own pkg trusted: False
 
 M_SafePkg7
-package dependencies: array-0.5.0.1 at array_GX4NwjS8xZkC2ZPtjgwhnz
+package dependencies: array-0.5.0.1 at array_<HASH>
 trusted: safe
 require own pkg trusted: False
 
 M_SafePkg8
-package dependencies: array-0.5.0.1 at array_GX4NwjS8xZkC2ZPtjgwhnz
+package dependencies: array-0.5.0.1 at array_<HASH>
 trusted: trustworthy
 require own pkg trusted: False
 



More information about the ghc-commits mailing list