summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/config/ghc1
-rw-r--r--testsuite/driver/testlib.py9
-rw-r--r--testsuite/mk/boilerplate.mk10
-rw-r--r--testsuite/mk/test.mk16
-rw-r--r--testsuite/tests/perf/haddock/all.T6
5 files changed, 31 insertions, 11 deletions
diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index 6bfa535876..5e4bda2e89 100644
--- a/testsuite/config/ghc
+++ b/testsuite/config/ghc
@@ -9,6 +9,7 @@ config.compiler_type = 'ghc'
config.compiler = 'ghc'
config.compiler_always_flags = ghc_compiler_always_flags.split()
+config.haddock = 'haddock'
config.hp2ps = 'hp2ps'
config.hpc = 'hpc'
config.gs = 'gs'
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 4e877f51b6..e9beee406e 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -123,6 +123,10 @@ def _reqlib( name, opts, lib ):
if not got_it:
opts.expect = 'missing-lib'
+def req_haddock( name, opts ):
+ if not config.haddock:
+ opts.expect = 'missing-lib'
+
def req_profiling( name, opts ):
if not config.have_profiling:
opts.expect = 'fail'
@@ -1128,7 +1132,10 @@ def checkStats(name, way, stats_file, range_fields):
result = passed()
if len(range_fields) > 0:
- f = open(in_testdir(stats_file))
+ try:
+ f = open(in_testdir(stats_file))
+ except IOError as e:
+ return failBecause(str(e))
contents = f.read()
f.close()
diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk
index 3292d3d67a..43bc4dfb08 100644
--- a/testsuite/mk/boilerplate.mk
+++ b/testsuite/mk/boilerplate.mk
@@ -108,6 +108,10 @@ ifeq "$(RUNGHC)" ""
RUNGHC := $(call find_tool,runghc)
endif
+ifeq "$(HADDOCK)" ""
+HADDOCK := $(call find_tool,haddock)
+endif
+
ifeq "$(HSC2HS)" ""
HSC2HS := $(call find_tool,hsc2hs)
endif
@@ -130,6 +134,12 @@ ifeq "$(shell test -x '$(GHC_PKG)' && echo exists)" ""
$(error Cannot find ghc-pkg: $(GHC_PKG))
endif
+$(eval $(call canonicaliseExecutable,HADDOCK))
+ifeq "$(shell test -x '$(HADDOCK)' && echo exists)" ""
+# haddock is optional.
+HADDOCK :=
+endif
+
$(eval $(call canonicaliseExecutable,HSC2HS))
ifeq "$(shell test -x '$(HSC2HS)' && echo exists)" ""
$(error Cannot find hsc2hs: $(HSC2HS))
diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk
index d1d66c781a..9927b6de1c 100644
--- a/testsuite/mk/test.mk
+++ b/testsuite/mk/test.mk
@@ -205,15 +205,17 @@ RUNTEST_OPTS += \
-e 'config.exeext="$(exeext)"' \
-e 'config.top="$(TOP_ABS)"'
-# Put an extra pair of quotes around program paths,
+# Put an extra pair of quotes around non-empty program paths,
# so we don't have to in .T scripts or driver/testlib.py.
+quote_path = $(if $1,"\"$1\"","")
RUNTEST_OPTS += \
- -e 'config.compiler="\"$(TEST_HC)\""' \
- -e 'config.ghc_pkg="\"$(GHC_PKG)\""' \
- -e 'config.hp2ps="\"$(HP2PS_ABS)\""' \
- -e 'config.hpc="\"$(HPC)\""' \
- -e 'config.gs="\"$(GS)\""' \
- -e 'config.timeout_prog="\"$(TIMEOUT_PROGRAM)\""'
+ -e 'config.compiler=$(call quote_path,$(TEST_HC))' \
+ -e 'config.ghc_pkg=$(call quote_path,$(GHC_PKG))' \
+ -e 'config.haddock=$(call quote_path,$(HADDOCK))' \
+ -e 'config.hp2ps=$(call quote_path,$(HP2PS_ABS))' \
+ -e 'config.hpc=$(call quote_path,$(HPC))' \
+ -e 'config.gs=$(call quote_path,$(GS))' \
+ -e 'config.timeout_prog=$(call quote_path,$(TIMEOUT_PROGRAM))'
ifneq "$(OUTPUT_SUMMARY)" ""
RUNTEST_OPTS += \
diff --git a/testsuite/tests/perf/haddock/all.T b/testsuite/tests/perf/haddock/all.T
index e9ffbb6275..bf2c00977d 100644
--- a/testsuite/tests/perf/haddock/all.T
+++ b/testsuite/tests/perf/haddock/all.T
@@ -3,7 +3,7 @@
# detect outliers, as described in Note [residency]. See #9556.
test('haddock.base',
- [unless(in_tree_compiler(), skip)
+ [unless(in_tree_compiler(), skip), req_haddock
,stats_num_field('bytes allocated',
[(wordsize(64), 9014511528, 5)
# 2012-08-14: 5920822352 (amd64/Linux)
@@ -43,7 +43,7 @@ test('haddock.base',
['../../../../libraries/base/dist-install/doc/html/base/base.haddock.t'])
test('haddock.Cabal',
- [unless(in_tree_compiler(), skip)
+ [unless(in_tree_compiler(), skip), req_haddock
,stats_num_field('bytes allocated',
[(wordsize(64), 6710234312, 5)
# 2012-08-14: 3255435248 (amd64/Linux)
@@ -84,7 +84,7 @@ test('haddock.Cabal',
['../../../../libraries/Cabal/Cabal/dist-install/doc/html/Cabal/Cabal.haddock.t'])
test('haddock.compiler',
- [unless(in_tree_compiler(), skip)
+ [unless(in_tree_compiler(), skip), req_haddock
,stats_num_field('bytes allocated',
[(wordsize(64), 33562468736, 10)
# 2012P-08-14: 26070600504 (amd64/Linux)