diff options
-rw-r--r-- | testsuite/driver/testlib.py | 26 | ||||
-rw-r--r-- | testsuite/mk/test.mk | 2 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_compile/all.T | 5 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/all.T | 4 | ||||
-rw-r--r-- | testsuite/tests/perf/space_leaks/all.T | 5 | ||||
-rw-r--r-- | testsuite/tests/profiling/should_run/all.T | 5 | ||||
-rw-r--r-- | testsuite/tests/rename/should_compile/T3103/test.T | 2 | ||||
-rw-r--r-- | testsuite/tests/safeHaskell/check/pkg01/all.T | 3 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_run/all.T | 3 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T5095.stderr | 2 |
10 files changed, 33 insertions, 24 deletions
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 diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index cead469765..a517698fe1 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -247,8 +247,6 @@ else RUNTEST_OPTS += -e config.ghc_built_by_llvm=True endif -RUNTEST_OPTS += -e 'config.integer_backend="$(INTEGER_LIBRARY)"' - RUNTEST_OPTS += \ --rootdir=. \ --config-file=$(CONFIG) \ diff --git a/testsuite/tests/numeric/should_compile/all.T b/testsuite/tests/numeric/should_compile/all.T index 5011627407..6177c66775 100644 --- a/testsuite/tests/numeric/should_compile/all.T +++ b/testsuite/tests/numeric/should_compile/all.T @@ -1,6 +1,7 @@ test('T7116', normal, run_command, ['$MAKE -s --no-print-directory T7116']) -test('T14170', normal, run_command, ['$MAKE -s --no-print-directory T14170']) -test('T14465', normal, run_command, ['$MAKE -s --no-print-directory T14465']) +# These test Core output that depends upon integer-gmp +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('T7881', normal, compile, ['']) # For T8542, the hpc way adds extra annotations that prevent diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T index 295e81892a..9d996db005 100644 --- a/testsuite/tests/numeric/should_run/all.T +++ b/testsuite/tests/numeric/should_run/all.T @@ -20,7 +20,9 @@ test('arith008', normal, compile_and_run, [opts]) test('arith009', 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]) diff --git a/testsuite/tests/perf/space_leaks/all.T b/testsuite/tests/perf/space_leaks/all.T index 1f69d12112..cde592b973 100644 --- a/testsuite/tests/perf/space_leaks/all.T +++ b/testsuite/tests/perf/space_leaks/all.T @@ -1,11 +1,12 @@ test('space_leak_001', # 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. [collect_stats(['peak_megabytes_allocated','bytes allocated'],5), collect_stats('max_bytes_used',15), - omit_ways(['profasm','profthreaded','threaded1','threaded2']) + omit_ways(['profasm','profthreaded','threaded1','threaded2']), + reqlib('integer-gmp') ], compile_and_run, ['']) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 050287e813..968d678164 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -115,7 +115,10 @@ test('T5363', [], 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, ['']) diff --git a/testsuite/tests/rename/should_compile/T3103/test.T b/testsuite/tests/rename/should_compile/T3103/test.T index 43f9fef4a7..38406b075c 100644 --- a/testsuite/tests/rename/should_compile/T3103/test.T +++ b/testsuite/tests/rename/should_compile/T3103/test.T @@ -1,5 +1,5 @@ # 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', '-v0 -hide-all-packages -package ghc-prim -package integer-gmp -this-unit-id base']) diff --git a/testsuite/tests/safeHaskell/check/pkg01/all.T b/testsuite/tests/safeHaskell/check/pkg01/all.T index 105ea5f26f..2b3d21a043 100644 --- a/testsuite/tests/safeHaskell/check/pkg01/all.T +++ b/testsuite/tests/safeHaskell/check/pkg01/all.T @@ -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']), normalise_errmsg_fun(ignoreLdOutput, normalise_errmsg), 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]) # Fail since we enable package trust diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index a9edee2b00..0a74c628c7 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -46,7 +46,8 @@ test('T3972', [], compile_and_run, ['']) test('T5315', normal, compile_and_run, ['']) test('T5453', normal, compile_and_run, ['']) 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('AmapCoerce', normal, compile_and_run, ['']) diff --git a/testsuite/tests/typecheck/should_fail/T5095.stderr b/testsuite/tests/typecheck/should_fail/T5095.stderr index ace7e916c8..ccf791dd47 100644 --- a/testsuite/tests/typecheck/should_fail/T5095.stderr +++ b/testsuite/tests/typecheck/should_fail/T5095.stderr @@ -7,7 +7,7 @@ T5095.hs:9:9: error: instance Eq Integer -- Defined in ‘integer-gmp-1.0.1.0:GHC.Integer.Type’ ...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) (The choice depends on the instantiation of ‘a’ To pick the first instance above, use IncoherentInstances |