summaryrefslogtreecommitdiff
path: root/testsuite/tests/safeHaskell
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-10-25 18:55:01 +0100
committerIan Lynagh <ian@well-typed.com>2012-10-25 18:55:01 +0100
commitb5897f9b4da8c20dd8b363547f1d3eeffb9ddb29 (patch)
tree3f20f0580648c87c6f3c8acefb664491e2b5ac29 /testsuite/tests/safeHaskell
parent83014ab82269e8ac5216c9ae430d31ab5f9eef78 (diff)
downloadhaskell-b5897f9b4da8c20dd8b363547f1d3eeffb9ddb29.tar.gz
Testsuite fixes for when we only have dynamic libraries
Diffstat (limited to 'testsuite/tests/safeHaskell')
-rw-r--r--testsuite/tests/safeHaskell/check/pkg01/Makefile24
-rw-r--r--testsuite/tests/safeHaskell/check/pkg01/all.T14
2 files changed, 27 insertions, 11 deletions
diff --git a/testsuite/tests/safeHaskell/check/pkg01/Makefile b/testsuite/tests/safeHaskell/check/pkg01/Makefile
index ee5d0038c9..eddd69af6b 100644
--- a/testsuite/tests/safeHaskell/check/pkg01/Makefile
+++ b/testsuite/tests/safeHaskell/check/pkg01/Makefile
@@ -20,6 +20,12 @@ $(eval $(call canonicalise,PREFIX))
PKGCONF = local.db
LGHC_PKG = '$(GHC_PKG)' --no-user-package-db -f '$(PKGCONF)'
+ifeq "$(GhcDynamicByDefault)" "YES"
+HI_SUF = dyn_hi
+else
+HI_SUF = hi
+endif
+
safePkg01:
'$(MAKE)' cleanSafePkg01
'$(TEST_HC)' --make -o setup Setup.hs -v0
@@ -29,7 +35,7 @@ safePkg01:
# we get a warning if dynlibs are enabled by default that:
# Warning: -rtsopts and -with-rtsopts have no effect with -shared.
# so we filter the flag out
- ./setup configure -v0 --prefix='$(PREFIX)' --with-compiler='$(TEST_HC)' --ghc-options='$(filter-out -rtsopts,$(TEST_HC_OPTS)) -fpackage-trust -trust base -trust bytestring' --with-hc-pkg='$(GHC_PKG)' --package-db='$(PKGCONF)' $(PROF)
+ ./setup configure -v0 --prefix='$(PREFIX)' --with-compiler='$(TEST_HC)' --ghc-options='$(filter-out -rtsopts,$(TEST_HC_OPTS)) -fpackage-trust -trust base -trust bytestring' --with-hc-pkg='$(GHC_PKG)' --package-db='$(PKGCONF)' $(VANILLA) $(PROF) $(DYN)
./setup build -v0
./setup copy -v0
./setup register --inplace -v0
@@ -37,28 +43,28 @@ safePkg01:
$(LGHC_PKG) field safePkg01-1.0 trusted
echo
echo 'M_SafePkg'
- '$(TEST_HC)' --show-iface dist/build/M_SafePkg.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
+ '$(TEST_HC)' --show-iface dist/build/M_SafePkg.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
echo
echo 'M_SafePkg2'
- '$(TEST_HC)' --show-iface dist/build/M_SafePkg2.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
+ '$(TEST_HC)' --show-iface dist/build/M_SafePkg2.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
echo
echo 'M_SafePkg3'
- '$(TEST_HC)' --show-iface dist/build/M_SafePkg3.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
+ '$(TEST_HC)' --show-iface dist/build/M_SafePkg3.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
echo
echo 'M_SafePkg4'
- '$(TEST_HC)' --show-iface dist/build/M_SafePkg4.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
+ '$(TEST_HC)' --show-iface dist/build/M_SafePkg4.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
echo
echo 'M_SafePkg5'
- '$(TEST_HC)' --show-iface dist/build/M_SafePkg5.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
+ '$(TEST_HC)' --show-iface dist/build/M_SafePkg5.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
echo
echo 'M_SafePkg6'
- '$(TEST_HC)' --show-iface dist/build/M_SafePkg6.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
+ '$(TEST_HC)' --show-iface dist/build/M_SafePkg6.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
echo
echo 'M_SafePkg7'
- '$(TEST_HC)' --show-iface dist/build/M_SafePkg7.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
+ '$(TEST_HC)' --show-iface dist/build/M_SafePkg7.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
echo
echo 'M_SafePkg8'
- '$(TEST_HC)' --show-iface dist/build/M_SafePkg8.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
+ '$(TEST_HC)' --show-iface dist/build/M_SafePkg8.$(HI_SUF) | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:'
echo
echo 'Testing setting trust'
$(LGHC_PKG) trust safePkg01-1.0
diff --git a/testsuite/tests/safeHaskell/check/pkg01/all.T b/testsuite/tests/safeHaskell/check/pkg01/all.T
index 0fde7237c9..103109bd6e 100644
--- a/testsuite/tests/safeHaskell/check/pkg01/all.T
+++ b/testsuite/tests/safeHaskell/check/pkg01/all.T
@@ -4,10 +4,20 @@ def f( opts ):
setTestOpts(f)
+if config.have_vanilla:
+ vanilla = '--enable-library-vanilla'
+else:
+ vanilla = '--disable-library-vanilla'
+
if config.have_profiling:
prof = '--enable-library-profiling'
else:
- prof = ''
+ prof = '--disable-library-profiling'
+
+if config.have_shared_libs:
+ dyn = '--enable-shared'
+else:
+ dyn = '--disable-shared'
# Test building a package, that trust values are set correctly
# and can be changed correctly
@@ -16,7 +26,7 @@ test('safePkg01',
# clean_cmd('$MAKE -s --no-print-directory cleanSafePkg01'),
alone],
run_command,
- ['$MAKE -s --no-print-directory safePkg01 PROF=' + prof])
+ ['$MAKE -s --no-print-directory safePkg01 VANILLA=' + vanilla + ' PROF=' + prof + ' DYN=' + dyn])
# Fail since we enable package trust
test('ImpSafe01', normal, compile_fail, ['-fpackage-trust -distrust base'])