summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@cs.stanford.edu>2014-10-27 17:52:39 -0700
committerEdward Z. Yang <ezyang@cs.stanford.edu>2014-10-27 17:52:39 -0700
commitaa2ceba33a8b98a2e8020464684f2eef7c98acf1 (patch)
tree6af11cdafcfd905118af69c1cba09e07e06deb8d
parent187450131877aef159fbfcdda0a5117f779f1688 (diff)
downloadhaskell-aa2ceba33a8b98a2e8020464684f2eef7c98acf1.tar.gz
Normalise package key hash to make tests less fragile.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
-rw-r--r--testsuite/tests/ghci/scripts/T5979.stderr6
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T9
-rw-r--r--testsuite/tests/safeHaskell/check/pkg01/all.T6
-rw-r--r--testsuite/tests/safeHaskell/check/pkg01/safePkg01.stdout6
4 files changed, 19 insertions, 8 deletions
diff --git a/testsuite/tests/ghci/scripts/T5979.stderr b/testsuite/tests/ghci/scripts/T5979.stderr
index c2869b09c6..c8fc7c2208 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@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>)
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index 1c8adeb6d0..ede9807d00 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 08f0b61820..8b33f27297 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 7ce7704d23..62074dedab 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@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