Normalise package key hash to make tests less fragile.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 28 Oct 2014 00:52:39 +0000 (17:52 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 28 Oct 2014 00:52:39 +0000 (17:52 -0700)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
testsuite/tests/ghci/scripts/T5979.stderr
testsuite/tests/ghci/scripts/all.T
testsuite/tests/safeHaskell/check/pkg01/all.T
testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout

index c2869b0..c8fc7c2 100644 (file)
@@ -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@trans_5jw4w9yTgmZ89ByuixDAKP)
-      Control.Monad.Trans.Class (from transformers-0.4.1.0@trans_5jw4w9yTgmZ89ByuixDAKP)
-      Control.Monad.Trans.Cont (from transformers-0.4.1.0@trans_5jw4w9yTgmZ89ByuixDAKP)
+      Control.Monad.Trans.State (from transformers-0.4.1.0@trans_<HASH>)
+      Control.Monad.Trans.Class (from transformers-0.4.1.0@trans_<HASH>)
+      Control.Monad.Trans.Cont (from transformers-0.4.1.0@trans_<HASH>)
index 1c8adeb..ede9807 100755 (executable)
@@ -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')],
index 08f0b61..8b33f27 100644 (file)
@@ -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])
index 7ce7704..62074de 100644 (file)
@@ -29,17 +29,17 @@ trusted: safe
 require own pkg trusted: True
 
 M_SafePkg6
-package dependencies: array-0.5.0.1@array_GX4NwjS8xZkC2ZPtjgwhnz
+package dependencies: array-0.5.0.1@array_<HASH>
 trusted: trustworthy
 require own pkg trusted: False
 
 M_SafePkg7
-package dependencies: array-0.5.0.1@array_GX4NwjS8xZkC2ZPtjgwhnz
+package dependencies: array-0.5.0.1@array_<HASH>
 trusted: safe
 require own pkg trusted: False
 
 M_SafePkg8
-package dependencies: array-0.5.0.1@array_GX4NwjS8xZkC2ZPtjgwhnz
+package dependencies: array-0.5.0.1@array_<HASH>
 trusted: trustworthy
 require own pkg trusted: False