Commit aa2ceba3 authored by Edward Z. Yang's avatar Edward Z. Yang

Normalise package key hash to make tests less fragile.

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 18745013
......@@ -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>)
# 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')],
......
......@@ -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])
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment