From 993782073c0b380908e9541c40c6c5849dbacfec Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 23 Dec 2018 06:34:00 +0000 Subject: 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. --- testsuite/driver/testlib.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'testsuite/driver') diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 1c6668ddc9..5f84863070 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -133,11 +133,12 @@ def stage1(name, opts): # Cache the results of looking to see if we have a library or not. # This makes quite a difference, especially on Windows. -have_lib = {} +have_lib_cache = {} -def _reqlib( name, opts, lib ): - if lib in have_lib: - got_it = have_lib[lib] +def have_library(lib): + """ Test whether the given library is available """ + if lib in have_lib_cache: + got_it = have_lib_cache[lib] else: cmd = strip_quotes(config.ghc_pkg) p = subprocess.Popen([cmd, '--no-user-package-db', 'describe', lib], @@ -149,9 +150,12 @@ def _reqlib( name, opts, lib ): p.communicate() r = p.wait() 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' def req_haddock( name, opts ): @@ -213,11 +217,6 @@ def record_broken(name, opts, bug): if not me in brokens: 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): # Helper function. Not intended for use in .T files. opts = getTestOpts() @@ -465,6 +464,9 @@ def have_gdb( ): def 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): @@ -1745,7 +1747,7 @@ def normalise_errmsg( str ): # Error messages sometimes contain this blurb which can vary # spuriously depending upon build configuration (e.g. based on integer # 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) # Also filter out bullet characters. This is because bullets are used to -- cgit v1.2.1