Commit 99378207 authored by Ben Gamari's avatar Ben Gamari 🐢

testsuite: Fix a variety of issues when building with integer-simple

 * Mark arith011 as broken with integer-simple

   As noted in #16091, arith011 fails when run against integer-simple with a
   "divide by zero" exception. This suggests that integer-gmp and integer-simple
   are handling division by zero differently.

 * This also fixes broken_without_gmp; the lack of types made the previous
   failure silent, sadly. Improves situation of #16043.

 * Mark several tests implicitly depending upon integer-gmp as broken
   with integer-simple. These expect to see Core coming from integer-gmp,
   which breaks with integer-simple.

 * Increase runtime timeout multiplier of T11627a with integer-simple

   I previously saw that T11627a timed out in all profiling ways when run against
   integer-simple. I suspect this is due to integer-simple's rather verbose heap
   representation. Let's see whether increasing the runtime timeout helps.

   Fixes test for #11627.

This is all in service of fixing #16043.
parent 6d9d6f9a
...@@ -133,11 +133,12 @@ def stage1(name, opts): ...@@ -133,11 +133,12 @@ def stage1(name, opts):
# Cache the results of looking to see if we have a library or not. # Cache the results of looking to see if we have a library or not.
# This makes quite a difference, especially on Windows. # This makes quite a difference, especially on Windows.
have_lib = {} have_lib_cache = {}
def _reqlib( name, opts, lib ): def have_library(lib):
if lib in have_lib: """ Test whether the given library is available """
got_it = have_lib[lib] if lib in have_lib_cache:
got_it = have_lib_cache[lib]
else: else:
cmd = strip_quotes(config.ghc_pkg) cmd = strip_quotes(config.ghc_pkg)
p = subprocess.Popen([cmd, '--no-user-package-db', 'describe', lib], p = subprocess.Popen([cmd, '--no-user-package-db', 'describe', lib],
...@@ -149,9 +150,12 @@ def _reqlib( name, opts, lib ): ...@@ -149,9 +150,12 @@ def _reqlib( name, opts, lib ):
p.communicate() p.communicate()
r = p.wait() r = p.wait()
got_it = r == 0 got_it = r == 0
have_lib[lib] = got_it have_lib_cache[lib] = got_it
return got_it
if not got_it: def _reqlib( name, opts, lib ):
if not have_library(lib):
opts.expect = 'missing-lib' opts.expect = 'missing-lib'
def req_haddock( name, opts ): def req_haddock( name, opts ):
...@@ -213,11 +217,6 @@ def record_broken(name, opts, bug): ...@@ -213,11 +217,6 @@ def record_broken(name, opts, bug):
if not me in brokens: if not me in brokens:
brokens.append(me) brokens.append(me)
def broken_without_gmp(name, opts):
# Many tests sadly break with integer-simple due to GHCi's ignorance of it.
when(config.integer_backend != "integer-gmp",
expect_broken(16043))
def _expect_pass(way): def _expect_pass(way):
# Helper function. Not intended for use in .T files. # Helper function. Not intended for use in .T files.
opts = getTestOpts() opts = getTestOpts()
...@@ -465,6 +464,9 @@ def have_gdb( ): ...@@ -465,6 +464,9 @@ def have_gdb( ):
def have_readelf( ): def have_readelf( ):
return config.have_readelf return config.have_readelf
# Many tests sadly break with integer-simple due to GHCi's ignorance of it.
broken_without_gmp = unless(have_library('integer-gmp'), expect_broken(16043))
# --- # ---
def high_memory_usage(name, opts): def high_memory_usage(name, opts):
...@@ -1745,7 +1747,7 @@ def normalise_errmsg( str ): ...@@ -1745,7 +1747,7 @@ def normalise_errmsg( str ):
# Error messages sometimes contain this blurb which can vary # Error messages sometimes contain this blurb which can vary
# spuriously depending upon build configuration (e.g. based on integer # spuriously depending upon build configuration (e.g. based on integer
# backend) # backend)
str = re.sub('...plus [a-z]+ instances involving out-of-scope types', str = re.sub('...plus ([a-z]+|[0-9]+) instances involving out-of-scope types',
'...plus N instances involving out-of-scope types', str) '...plus N instances involving out-of-scope types', str)
# Also filter out bullet characters. This is because bullets are used to # Also filter out bullet characters. This is because bullets are used to
......
...@@ -247,8 +247,6 @@ else ...@@ -247,8 +247,6 @@ else
RUNTEST_OPTS += -e config.ghc_built_by_llvm=True RUNTEST_OPTS += -e config.ghc_built_by_llvm=True
endif endif
RUNTEST_OPTS += -e 'config.integer_backend="$(INTEGER_LIBRARY)"'
RUNTEST_OPTS += \ RUNTEST_OPTS += \
--rootdir=. \ --rootdir=. \
--config-file=$(CONFIG) \ --config-file=$(CONFIG) \
......
test('T7116', normal, run_command, ['$MAKE -s --no-print-directory T7116']) test('T7116', normal, run_command, ['$MAKE -s --no-print-directory T7116'])
test('T14170', normal, run_command, ['$MAKE -s --no-print-directory T14170']) # These test Core output that depends upon integer-gmp
test('T14465', normal, run_command, ['$MAKE -s --no-print-directory T14465']) test('T14170', reqlib("integer-gmp"), run_command, ['$MAKE -s --no-print-directory T14170'])
test('T14465', reqlib("integer-gmp"), run_command, ['$MAKE -s --no-print-directory T14465'])
test('T7895', normal, compile, ['']) test('T7895', normal, compile, [''])
test('T7881', normal, compile, ['']) test('T7881', normal, compile, [''])
# For T8542, the hpc way adds extra annotations that prevent # For T8542, the hpc way adds extra annotations that prevent
......
...@@ -20,7 +20,9 @@ test('arith008', normal, compile_and_run, [opts]) ...@@ -20,7 +20,9 @@ test('arith008', normal, compile_and_run, [opts])
test('arith009', normal, compile_and_run, ['']) test('arith009', normal, compile_and_run, [''])
test('arith010', normal, compile_and_run, ['']) test('arith010', normal, compile_and_run, [''])
test('arith011', normal, compile_and_run, ['']) test('arith011',
when(have_library("integer-simple"), expect_broken(16091)),
compile_and_run, [''])
test('arith012', normal, compile_and_run, [opts]) test('arith012', normal, compile_and_run, [opts])
......
test('space_leak_001', test('space_leak_001',
# This could potentially be replaced with # This could potentially be replaced with
# collect_stats('all',5) to test all 3 with # collect_stats('all',5) to test all 3 with
# 5% possible deviation. # 5% possible deviation.
[collect_stats(['peak_megabytes_allocated','bytes allocated'],5), [collect_stats(['peak_megabytes_allocated','bytes allocated'],5),
collect_stats('max_bytes_used',15), collect_stats('max_bytes_used',15),
omit_ways(['profasm','profthreaded','threaded1','threaded2']) omit_ways(['profasm','profthreaded','threaded1','threaded2']),
reqlib('integer-gmp')
], ],
compile_and_run, compile_and_run,
['']) [''])
......
...@@ -115,7 +115,10 @@ test('T5363', [], compile_and_run, ['']) ...@@ -115,7 +115,10 @@ test('T5363', [], compile_and_run, [''])
test('profinline001', [], compile_and_run, ['']) test('profinline001', [], compile_and_run, [''])
test('T11627a', [ extra_ways(extra_prof_ways) test('T11627a', [ extra_ways(extra_prof_ways),
# integer-simple has an extremely large representation and
# consequently needs significantly more time
when(have_library('integer-simple'), skip)
], ],
compile_and_run, ['']) compile_and_run, [''])
......
# Args to vtc are: extra compile flags # Args to vtc are: extra compile flags
test('T3103', [extra_files(['Foreign/', 'GHC/'])], multimod_compile, test('T3103', [reqlib("integer-gmp"), extra_files(['Foreign/', 'GHC/'])], multimod_compile,
['Foreign.Ptr', ['Foreign.Ptr',
'-v0 -hide-all-packages -package ghc-prim -package integer-gmp -this-unit-id base']) '-v0 -hide-all-packages -package ghc-prim -package integer-gmp -this-unit-id base'])
...@@ -30,7 +30,8 @@ test('safePkg01', ...@@ -30,7 +30,8 @@ test('safePkg01',
[extra_files(['M_SafePkg.hs', 'M_SafePkg2.hs', 'M_SafePkg3.hs', 'M_SafePkg4.hs', 'M_SafePkg5.hs', 'M_SafePkg6.hs', 'M_SafePkg7.hs', 'M_SafePkg8.hs', 'Setup.hs', 'p.cabal']), [extra_files(['M_SafePkg.hs', 'M_SafePkg2.hs', 'M_SafePkg3.hs', 'M_SafePkg4.hs', 'M_SafePkg5.hs', 'M_SafePkg6.hs', 'M_SafePkg7.hs', 'M_SafePkg8.hs', 'Setup.hs', 'p.cabal']),
normalise_errmsg_fun(ignoreLdOutput, normalise_errmsg), normalise_errmsg_fun(ignoreLdOutput, normalise_errmsg),
normalise_version("array", "integer-gmp", "integer-simple", "bytestring", normalise_version("array", "integer-gmp", "integer-simple", "bytestring",
"base", "deepseq", "ghc-prim")], "base", "deepseq", "ghc-prim"),
normalise_fun(normalise_errmsg)],
run_command, ['$MAKE -s --no-print-directory safePkg01 ' + make_args]) run_command, ['$MAKE -s --no-print-directory safePkg01 ' + make_args])
# Fail since we enable package trust # Fail since we enable package trust
......
...@@ -46,7 +46,8 @@ test('T3972', [], compile_and_run, ['']) ...@@ -46,7 +46,8 @@ test('T3972', [], compile_and_run, [''])
test('T5315', normal, compile_and_run, ['']) test('T5315', normal, compile_and_run, [''])
test('T5453', normal, compile_and_run, ['']) test('T5453', normal, compile_and_run, [''])
test('T5441', [], multimod_compile_and_run, ['T5441', '']) test('T5441', [], multimod_compile_and_run, ['T5441', ''])
test('T5603', normal, compile_and_run, ['']) # This compares Core from integer-gmp
test('T5603', reqlib('integer-gmp'), compile_and_run, [''])
test('T2110', normal, compile_and_run, ['']) test('T2110', normal, compile_and_run, [''])
test('AmapCoerce', normal, compile_and_run, ['']) test('AmapCoerce', normal, compile_and_run, [''])
......
...@@ -7,7 +7,7 @@ T5095.hs:9:9: error: ...@@ -7,7 +7,7 @@ T5095.hs:9:9: error:
instance Eq Integer instance Eq Integer
-- Defined in ‘integer-gmp-1.0.1.0:GHC.Integer.Type’ -- Defined in ‘integer-gmp-1.0.1.0:GHC.Integer.Type’
...plus 23 others ...plus 23 others
...plus 7 instances involving out-of-scope types ...plus N instances involving out-of-scope types
(use -fprint-potential-instances to see them all) (use -fprint-potential-instances to see them all)
(The choice depends on the instantiation of ‘a’ (The choice depends on the instantiation of ‘a’
To pick the first instance above, use IncoherentInstances To pick the first instance above, use IncoherentInstances
......
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