Commit b5897f9b authored by ian@well-typed.com's avatar ian@well-typed.com

Testsuite fixes for when we only have dynamic libraries

parent 83014ab8
...@@ -35,6 +35,9 @@ if (ghc_with_native_codegen == 1): ...@@ -35,6 +35,9 @@ if (ghc_with_native_codegen == 1):
config.compile_ways.append('optasm') config.compile_ways.append('optasm')
config.run_ways.append('optasm') config.run_ways.append('optasm')
if (ghc_with_vanilla == 1):
config.have_vanilla = True
if (ghc_with_profiling == 1): if (ghc_with_profiling == 1):
config.have_profiling = True config.have_profiling = True
config.compile_ways.append('profasm') config.compile_ways.append('profasm')
......
...@@ -78,6 +78,9 @@ class TestConfig: ...@@ -78,6 +78,9 @@ class TestConfig:
self.way_flags = {} self.way_flags = {}
self.way_rts_flags = {} self.way_rts_flags = {}
# Do we have vanilla libraries?
self.have_vanilla = False
# Do we have profiling support? # Do we have profiling support?
self.have_profiling = False self.have_profiling = False
......
...@@ -46,8 +46,15 @@ RUNTEST_OPTS += -e ghc_with_native_codegen=0 ...@@ -46,8 +46,15 @@ RUNTEST_OPTS += -e ghc_with_native_codegen=0
endif endif
HASKELL98_LIBDIR := $(shell "$(GHC_PKG)" field haskell98 library-dirs | sed 's/^[^:]*: *//') HASKELL98_LIBDIR := $(shell "$(GHC_PKG)" field haskell98 library-dirs | sed 's/^[^:]*: *//')
HAVE_VANILLA := $(shell if [ -f $(subst \,/,$(HASKELL98_LIBDIR))/libHShaskell98-*.a ]; then echo YES; else echo NO; fi)
HAVE_PROFILING := $(shell if [ -f $(subst \,/,$(HASKELL98_LIBDIR))/libHShaskell98-*_p.a ]; then echo YES; else echo NO; fi) HAVE_PROFILING := $(shell if [ -f $(subst \,/,$(HASKELL98_LIBDIR))/libHShaskell98-*_p.a ]; then echo YES; else echo NO; fi)
ifeq "$(HAVE_VANILLA)" "YES"
RUNTEST_OPTS += -e ghc_with_vanilla=1
else
RUNTEST_OPTS += -e ghc_with_vanilla=0
endif
ifeq "$(HAVE_PROFILING)" "YES" ifeq "$(HAVE_PROFILING)" "YES"
RUNTEST_OPTS += -e ghc_with_profiling=1 RUNTEST_OPTS += -e ghc_with_profiling=1
else else
...@@ -82,8 +89,10 @@ endif ...@@ -82,8 +89,10 @@ endif
ifeq "$(GhcDynamicByDefault)" "YES" ifeq "$(GhcDynamicByDefault)" "YES"
RUNTEST_OPTS += -e ghc_dynamic_by_default=True RUNTEST_OPTS += -e ghc_dynamic_by_default=True
CABAL_MINIMAL_BUILD = --enable-shared --disable-library-vanilla
else else
RUNTEST_OPTS += -e ghc_dynamic_by_default=False RUNTEST_OPTS += -e ghc_dynamic_by_default=False
CABAL_MINIMAL_BUILD = --enable-library-vanilla --disable-shared
endif endif
ifeq "$(GhcWithSMP)" "YES" ifeq "$(GhcWithSMP)" "YES"
......
...@@ -28,7 +28,7 @@ cabal01: ...@@ -28,7 +28,7 @@ cabal01:
# we get a warning if dynlibs are enabled by default that: # we get a warning if dynlibs are enabled by default that:
# Warning: -rtsopts and -with-rtsopts have no effect with -shared. # Warning: -rtsopts and -with-rtsopts have no effect with -shared.
# so we filter the flag out # so we filter the flag out
./setup configure -v0 --prefix=$(PREFIX) --with-compiler='$(TEST_HC)' --ghc-options='$(filter-out -rtsopts,$(TEST_HC_OPTS))' --with-hc-pkg='$(GHC_PKG)' --package-db=local.db $(PROF) ./setup configure -v0 --prefix=$(PREFIX) --with-compiler='$(TEST_HC)' --ghc-options='$(filter-out -rtsopts,$(TEST_HC_OPTS))' --with-hc-pkg='$(GHC_PKG)' --package-db=local.db $(VANILLA) $(PROF) $(DYN)
./setup build -v0 ./setup build -v0
./setup copy -v0 ./setup copy -v0
echo install1: echo install1:
......
setTestOpts(only_compiler_types(['ghc'])) setTestOpts(only_compiler_types(['ghc']))
if config.have_vanilla:
vanilla = '--enable-library-vanilla'
else:
vanilla = '--disable-library-vanilla'
if config.have_profiling: if config.have_profiling:
prof = '--enable-library-profiling' prof = '--enable-library-profiling'
else: else:
prof = '' prof = '--disable-library-profiling'
if config.have_shared_libs:
dyn = '--enable-shared'
else:
dyn = '--disable-shared'
if default_testopts.cleanup != '': if default_testopts.cleanup != '':
cleanup = 'CLEANUP=1' cleanup = 'CLEANUP=1'
...@@ -13,4 +23,4 @@ else: ...@@ -13,4 +23,4 @@ else:
test('cabal01', test('cabal01',
normal, normal,
run_command, run_command,
['$MAKE -s --no-print-directory cabal01 PROF=' + prof + ' ' + cleanup]) ['$MAKE -s --no-print-directory cabal01 VANILLA=' + vanilla + ' PROF=' + prof + ' DYN=' + dyn + ' ' + cleanup])
...@@ -20,17 +20,17 @@ cabal03: clean ...@@ -20,17 +20,17 @@ cabal03: clean
'$(GHC_PKG)' init tmp.d '$(GHC_PKG)' init tmp.d
'$(TEST_HC)' -v0 --make Setup '$(TEST_HC)' -v0 --make Setup
cd p && $(SETUP) clean cd p && $(SETUP) clean
cd p && $(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --disable-optimisation --ghc-pkg-option=--force cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --disable-optimisation --ghc-pkg-option=--force
cd p && $(SETUP) build cd p && $(SETUP) build
cd p && $(SETUP) register cd p && $(SETUP) register
cd q && $(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force cd q && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
cd q && $(SETUP) build cd q && $(SETUP) build
cd q && $(SETUP) register cd q && $(SETUP) register
cd p && $(SETUP) clean cd p && $(SETUP) clean
cd p && $(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
cd p && $(SETUP) build cd p && $(SETUP) build
cd p && $(SETUP) register cd p && $(SETUP) register
cd r && ! ../Setup configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force cd r && ! ../Setup configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
ifneq "$(CLEANUP)" "" ifneq "$(CLEANUP)" ""
$(MAKE) clean $(MAKE) clean
endif endif
......
...@@ -14,7 +14,7 @@ cabal04: ...@@ -14,7 +14,7 @@ cabal04:
$(MAKE) clean $(MAKE) clean
'$(TEST_HC)' -v0 --make Setup '$(TEST_HC)' -v0 --make Setup
$(SETUP) clean $(SETUP) clean
$(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(filter-out -rtsopts,$(TEST_HC_OPTS))' $(PROF) $(DYN) $(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(filter-out -rtsopts,$(TEST_HC_OPTS))' $(VANILLA) $(PROF) $(DYN)
$(SETUP) build 2> err $(SETUP) build 2> err
! grep -v "Creating library file" err ! grep -v "Creating library file" err
ifneq "$(CLEANUP)" "" ifneq "$(CLEANUP)" ""
......
setTestOpts(only_compiler_types(['ghc'])) setTestOpts(only_compiler_types(['ghc']))
if config.have_vanilla:
vanilla = '--enable-library-vanilla'
else:
vanilla = '--disable-library-vanilla'
if config.have_profiling: if config.have_profiling:
prof = '--enable-library-profiling' prof = '--enable-library-profiling'
else: else:
prof = '' prof = '--disable-library-profiling'
if config.have_shared_libs: if config.have_shared_libs:
dyn = '--enable-shared' dyn = '--enable-shared'
else: else:
dyn = '' dyn = '--disable-shared'
if default_testopts.cleanup != '': if default_testopts.cleanup != '':
cleanup = 'CLEANUP=1' cleanup = 'CLEANUP=1'
...@@ -18,4 +23,4 @@ else: ...@@ -18,4 +23,4 @@ else:
test('cabal04', test('cabal04',
normal, normal,
run_command, run_command,
['$MAKE -s --no-print-directory cabal04 PROF=' + prof + ' DYN=' + dyn + ' ' + cleanup]) ['$MAKE -s --no-print-directory cabal04 VANILLA=' + vanilla + ' PROF=' + prof + ' DYN=' + dyn + ' ' + cleanup])
...@@ -4,28 +4,28 @@ testpkg-1.2.3.4: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a di ...@@ -4,28 +4,28 @@ testpkg-1.2.3.4: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a di
testpkg-1.2.3.4: import-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring) testpkg-1.2.3.4: import-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
testpkg-1.2.3.4: library-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring) testpkg-1.2.3.4: library-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
testpkg-1.2.3.4: include-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring) testpkg-1.2.3.4: include-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
testpkg-1.2.3.4: file A.hi is missing (ignoring) testpkg-1.2.3.4: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring)
testpkg-1.2.3.4: file B.hi is missing (ignoring) testpkg-1.2.3.4: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring)
testpkg-1.2.3.4: file C/D.hi is missing (ignoring) testpkg-1.2.3.4: cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] (ignoring)
testpkg-1.2.3.4: cannot find libtestpkg-1.2.3.4.a on library path (ignoring) testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4.a","libtestpkg-1.2.3.4.p_a","libtestpkg-1.2.3.4-ghc7.7.20121025.so","libtestpkg-1.2.3.4-ghc7.7.20121025.dylib","testpkg-1.2.3.4-ghc7.7.20121025.dll"] on library path (ignoring)
testpkg-2.0: Warning: library-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory testpkg-2.0: Warning: library-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory
testpkg-2.0: Warning: include-dirs: /usr/local/include/testpkg doesn't exist or isn't a directory testpkg-2.0: Warning: include-dirs: /usr/local/include/testpkg doesn't exist or isn't a directory
testpkg-2.0: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory (ignoring) testpkg-2.0: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory (ignoring)
testpkg-2.0: import-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring) testpkg-2.0: import-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
testpkg-2.0: library-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring) testpkg-2.0: library-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
testpkg-2.0: include-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring) testpkg-2.0: include-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
testpkg-2.0: file A.hi is missing (ignoring) testpkg-2.0: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring)
testpkg-2.0: file B.hi is missing (ignoring) testpkg-2.0: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring)
testpkg-2.0: file C/D.hi is missing (ignoring) testpkg-2.0: cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] (ignoring)
testpkg-2.0: file C/E.hi is missing (ignoring) testpkg-2.0: cannot find any of ["C/E.hi","C/E.p_hi","C/E.dyn_hi"] (ignoring)
testpkg-2.0: cannot find libtestpkg-2.0.a on library path (ignoring) testpkg-2.0: cannot find any of ["libtestpkg-2.0.a","libtestpkg-2.0.p_a","libtestpkg-2.0-ghc7.7.20121025.so","libtestpkg-2.0-ghc7.7.20121025.dylib","testpkg-2.0-ghc7.7.20121025.dll"] on library path (ignoring)
testpkg-1.2.3.4: Warning: library-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory testpkg-1.2.3.4: Warning: library-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory
testpkg-1.2.3.4: Warning: include-dirs: /usr/local/include/testpkg doesn't exist or isn't a directory testpkg-1.2.3.4: Warning: include-dirs: /usr/local/include/testpkg doesn't exist or isn't a directory
testpkg-1.2.3.4: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory (ignoring) testpkg-1.2.3.4: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory (ignoring)
testpkg-1.2.3.4: import-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring) testpkg-1.2.3.4: import-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
testpkg-1.2.3.4: library-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring) testpkg-1.2.3.4: library-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
testpkg-1.2.3.4: include-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring) testpkg-1.2.3.4: include-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
testpkg-1.2.3.4: file A.hi is missing (ignoring) testpkg-1.2.3.4: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring)
testpkg-1.2.3.4: file B.hi is missing (ignoring) testpkg-1.2.3.4: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring)
testpkg-1.2.3.4: file C/D.hi is missing (ignoring) testpkg-1.2.3.4: cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] (ignoring)
testpkg-1.2.3.4: cannot find libtestpkg-1.2.3.4.a on library path (ignoring) testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4.a","libtestpkg-1.2.3.4.p_a","libtestpkg-1.2.3.4-ghc7.7.20121025.so","libtestpkg-1.2.3.4-ghc7.7.20121025.dylib","testpkg-1.2.3.4-ghc7.7.20121025.dll"] on library path (ignoring)
...@@ -5,11 +5,11 @@ There are problems in package testpkg-2.0: ...@@ -5,11 +5,11 @@ There are problems in package testpkg-2.0:
import-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. import-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}.
library-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. library-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}.
include-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. include-dirs: c:/Program Files/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}.
file A.hi is missing cannot find any of ["A.hi","A.p_hi","A.dyn_hi"]
file B.hi is missing cannot find any of ["B.hi","B.p_hi","B.dyn_hi"]
file C/D.hi is missing cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"]
file C/E.hi is missing cannot find any of ["C/E.hi","C/E.p_hi","C/E.dyn_hi"]
cannot find libtestpkg-2.0.a on library path cannot find any of ["libtestpkg-2.0.a","libtestpkg-2.0.p_a","libtestpkg-2.0-ghc7.7.20121025.so","libtestpkg-2.0-ghc7.7.20121025.dylib","testpkg-2.0-ghc7.7.20121025.dll"] on library path
The following packages are broken, either because they have a problem The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package. listed above, or because they depend on a broken package.
......
...@@ -35,7 +35,7 @@ prep: ...@@ -35,7 +35,7 @@ prep:
prep.%: prep.%:
cd $* && "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -v0 --make -o setup Setup.hs cd $* && "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -v0 --make -o setup Setup.hs
cd $* && ./setup configure -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=../$(LOCAL_PKGCONF) cd $* && ./setup configure $(CABAL_MINIMAL_BUILD) -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=../$(LOCAL_PKGCONF)
cd $* && ./setup build -v0 cd $* && ./setup build -v0
cd $* && ./setup register -v0 --inplace cd $* && ./setup register -v0 --inplace
...@@ -20,6 +20,6 @@ package: ...@@ -20,6 +20,6 @@ package:
echo "[]" >$(LOCAL_PKGCONF) echo "[]" >$(LOCAL_PKGCONF)
./setup configure -v0 --prefix="$(PREFIX)" --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=$(LOCAL_PKGCONF) ./setup configure $(CABAL_MINIMAL_BUILD) -v0 --prefix="$(PREFIX)" --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=$(LOCAL_PKGCONF)
./setup build -v0 ./setup build -v0
./setup install -v0 ./setup install -v0
...@@ -18,11 +18,17 @@ include $(TOP)/mk/test.mk ...@@ -18,11 +18,17 @@ include $(TOP)/mk/test.mk
LOCAL_PKGCONF=local.package.conf LOCAL_PKGCONF=local.package.conf
LOCAL_GHC_PKG = '$(GHC_PKG)' --no-user-package-db -f $(LOCAL_PKGCONF) LOCAL_GHC_PKG = '$(GHC_PKG)' --no-user-package-db -f $(LOCAL_PKGCONF)
ifeq "$(GhcDynamicByDefault)" "YES"
RM_PROG006_EXTRA_FLAGS = -hisuf dyn_hi -osuf dyn_o
endif
rn.prog006: rn.prog006:
rm -f A.hi A.o B/C.hi B/C.o Main.hi Main.o pkg.conf rm -f A.hi A.o B/C.hi B/C.o Main.hi Main.o
rm -f A.dyn_hi A.dyn_o B/C.dyn_hi B/C.dyn_o Main.dyn_hi Main.dyn_o
rm -f pkg.conf
rm -f pwd pwd.exe pwd.exe.manifest pwd.hi pwd.o rm -f pwd pwd.exe pwd.exe.manifest pwd.hi pwd.o
'$(TEST_HC)' $(TEST_HC_OPTS) --make pwd -v0 '$(TEST_HC)' $(TEST_HC_OPTS) --make pwd -v0
'$(TEST_HC)' $(TEST_HC_OPTS) --make -package-name test-1.0 B.C -fforce-recomp -v0 '$(TEST_HC)' $(TEST_HC_OPTS) --make -package-name test-1.0 B.C -fforce-recomp -v0 $(RM_PROG006_EXTRA_FLAGS)
rm -f pkg.conf rm -f pkg.conf
echo "name: test" >>pkg.conf echo "name: test" >>pkg.conf
echo "version: 1.0" >>pkg.conf echo "version: 1.0" >>pkg.conf
......
...@@ -20,6 +20,12 @@ $(eval $(call canonicalise,PREFIX)) ...@@ -20,6 +20,12 @@ $(eval $(call canonicalise,PREFIX))
PKGCONF = local.db PKGCONF = local.db
LGHC_PKG = '$(GHC_PKG)' --no-user-package-db -f '$(PKGCONF)' LGHC_PKG = '$(GHC_PKG)' --no-user-package-db -f '$(PKGCONF)'
ifeq "$(GhcDynamicByDefault)" "YES"
HI_SUF = dyn_hi
else
HI_SUF = hi
endif
safePkg01: safePkg01:
'$(MAKE)' cleanSafePkg01 '$(MAKE)' cleanSafePkg01
'$(TEST_HC)' --make -o setup Setup.hs -v0 '$(TEST_HC)' --make -o setup Setup.hs -v0
...@@ -29,7 +35,7 @@ safePkg01: ...@@ -29,7 +35,7 @@ safePkg01:
# we get a warning if dynlibs are enabled by default that: # we get a warning if dynlibs are enabled by default that:
# Warning: -rtsopts and -with-rtsopts have no effect with -shared. # Warning: -rtsopts and -with-rtsopts have no effect with -shared.
# so we filter the flag out # 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 build -v0
./setup copy -v0 ./setup copy -v0
./setup register --inplace -v0 ./setup register --inplace -v0
...@@ -37,28 +43,28 @@ safePkg01: ...@@ -37,28 +43,28 @@ safePkg01:
$(LGHC_PKG) field safePkg01-1.0 trusted $(LGHC_PKG) field safePkg01-1.0 trusted
echo echo
echo 'M_SafePkg' 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
echo 'M_SafePkg2' 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
echo 'M_SafePkg3' 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
echo 'M_SafePkg4' 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
echo 'M_SafePkg5' 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
echo 'M_SafePkg6' 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
echo 'M_SafePkg7' 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
echo 'M_SafePkg8' 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
echo 'Testing setting trust' echo 'Testing setting trust'
$(LGHC_PKG) trust safePkg01-1.0 $(LGHC_PKG) trust safePkg01-1.0
......
...@@ -4,10 +4,20 @@ def f( opts ): ...@@ -4,10 +4,20 @@ def f( opts ):
setTestOpts(f) setTestOpts(f)
if config.have_vanilla:
vanilla = '--enable-library-vanilla'
else:
vanilla = '--disable-library-vanilla'
if config.have_profiling: if config.have_profiling:
prof = '--enable-library-profiling' prof = '--enable-library-profiling'
else: 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 # Test building a package, that trust values are set correctly
# and can be changed correctly # and can be changed correctly
...@@ -16,7 +26,7 @@ test('safePkg01', ...@@ -16,7 +26,7 @@ test('safePkg01',
# clean_cmd('$MAKE -s --no-print-directory cleanSafePkg01'), # clean_cmd('$MAKE -s --no-print-directory cleanSafePkg01'),
alone], alone],
run_command, 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 # Fail since we enable package trust
test('ImpSafe01', normal, compile_fail, ['-fpackage-trust -distrust base']) test('ImpSafe01', normal, compile_fail, ['-fpackage-trust -distrust base'])
......
...@@ -28,6 +28,6 @@ prep: ...@@ -28,6 +28,6 @@ prep:
prep.%: prep.%:
cd $* && '$(TEST_HC)' -v0 --make -o setup Setup.hs cd $* && '$(TEST_HC)' -v0 --make -o setup Setup.hs
cd $* && ./setup configure -v0 --with-compiler='$(TEST_HC)' --with-ghc-pkg='$(GHC_PKG)' --package-db ../$(LOCAL_PKGCONF) cd $* && ./setup configure $(CABAL_MINIMAL_BUILD) -v0 --with-compiler='$(TEST_HC)' --with-ghc-pkg='$(GHC_PKG)' --package-db ../$(LOCAL_PKGCONF)
cd $* && ./setup build -v0 cd $* && ./setup build -v0
cd $* && ./setup register -v0 --inplace cd $* && ./setup register -v0 --inplace
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