From aa2ceba33a8b98a2e8020464684f2eef7c98acf1 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Mon, 27 Oct 2014 17:52:39 -0700 Subject: Normalise package key hash to make tests less fragile. Signed-off-by: Edward Z. Yang --- 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 c2869b09c6..c8fc7c2208 100644 --- a/testsuite/tests/ghci/scripts/T5979.stderr +++ b/testsuite/tests/ghci/scripts/T5979.stderr @@ -2,6 +2,6 @@ : 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_) + Control.Monad.Trans.Class (from transformers-0.4.1.0@trans_) + Control.Monad.Trans.Cont (from transformers-0.4.1.0@trans_) 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_', 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-', str) +def normaliseArrayPackageKey(str): + return re.sub('array_[A-Za-z0-9]+', 'array_', 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_ 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_ 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_ trusted: trustworthy require own pkg trusted: False -- cgit v1.2.1