[commit: ghc] wip/remove-cabal-dep: Change testsuite to not use old-style file package databases (7273bf0)

git at git.haskell.org git at git.haskell.org
Wed Aug 27 19:25:05 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/remove-cabal-dep
Link       : http://ghc.haskell.org/trac/ghc/changeset/7273bf071d1b2cf433d249b9a2abee4a6c6aa653/ghc

>---------------------------------------------------------------

commit 7273bf071d1b2cf433d249b9a2abee4a6c6aa653
Author: Duncan Coutts <duncan at well-typed.com>
Date:   Wed Aug 27 16:33:20 2014 +0100

    Change testsuite to not use old-style file package databases
    
    Now uses ghc-pkg init. The file-style databases are no longer supported.


>---------------------------------------------------------------

7273bf071d1b2cf433d249b9a2abee4a6c6aa653
 testsuite/tests/driver/T1372/Makefile                         | 4 ++--
 testsuite/tests/driver/T3007/Makefile                         | 4 ++--
 testsuite/tests/ghci/linking/Makefile                         | 6 +++---
 testsuite/tests/plugins/simple-plugin/Makefile                | 2 +-
 testsuite/tests/rename/prog006/Makefile                       | 3 ++-
 testsuite/tests/simplCore/should_compile/T7702plugin/Makefile | 2 +-
 testsuite/tests/typecheck/bug1465/Makefile                    | 4 ++--
 7 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/testsuite/tests/driver/T1372/Makefile b/testsuite/tests/driver/T1372/Makefile
index 91ef6d5..acd6b66 100644
--- a/testsuite/tests/driver/T1372/Makefile
+++ b/testsuite/tests/driver/T1372/Makefile
@@ -15,7 +15,7 @@ clean:
 	rm -f *.o *.hi
 	rm -f clean.out prep.out
 	rm -f p1/A.hs
-	rm -f $(LOCAL_PKGCONF)
+	rm -rf $(LOCAL_PKGCONF)
 
 T1372:
 	$(MAKE) clean
@@ -26,7 +26,7 @@ T1372:
 	$(MAKE) clean
 
 prep:
-	echo "[]" >$(LOCAL_PKGCONF)
+	"$(GHC_PKG)" init $(LOCAL_PKGCONF)
 	cp p1/A1.hs p1/A.hs
 	$(MAKE) prep.p1
 	$(MAKE) prep.p2
diff --git a/testsuite/tests/driver/T3007/Makefile b/testsuite/tests/driver/T3007/Makefile
index 7161225..8b78a49 100644
--- a/testsuite/tests/driver/T3007/Makefile
+++ b/testsuite/tests/driver/T3007/Makefile
@@ -6,11 +6,11 @@ clean:
 	rm -f A/Setup A/Setup.o A/Setup.hi
 	rm -f B/Setup B/Setup.o B/Setup.hi
 	rm -rf A/dist B/dist
-	rm -f package.conf
+	rm -rf package.conf
 
 T3007:
 	$(MAKE) clean
-	echo '[]' > package.conf
+	'$(GHC_PKG)' init package.conf
 	cd A && '$(TEST_HC)' -v0 --make Setup
 	cd A && ./Setup configure -v0 --with-compiler='$(TEST_HC)' --ghc-pkg-option=--global-package-db=../package.conf --ghc-option=-package-db../package.conf
 	cd A && ./Setup build -v0
diff --git a/testsuite/tests/ghci/linking/Makefile b/testsuite/tests/ghci/linking/Makefile
index 08c5158..5b8e23c 100644
--- a/testsuite/tests/ghci/linking/Makefile
+++ b/testsuite/tests/ghci/linking/Makefile
@@ -63,7 +63,7 @@ ghcilink004 :
 	echo 'key: test-1.0' >>$(PKG004)
 	echo 'library-dirs: $${pkgroot}' >>$(PKG004)
 	echo 'extra-libraries: foo' >>$(PKG004)
-	echo '[]' >$(LOCAL_PKGCONF004)
+	'$(GHC_PKG)' init $(LOCAL_PKGCONF004)
 	'$(GHC_PKG)' --no-user-package-db -f $(LOCAL_PKGCONF004) register $(PKG004) -v0
 	#
 	"$(TEST_HC)" -c f.c -o dir004/foo.o
@@ -91,7 +91,7 @@ ghcilink005 :
 	echo 'key: test-1.0' >>$(PKG005)
 	echo 'library-dirs: $${pkgroot}' >>$(PKG005)
 	echo 'extra-libraries: foo' >>$(PKG005)
-	echo '[]' >$(LOCAL_PKGCONF005)
+	'$(GHC_PKG)' init $(LOCAL_PKGCONF005)
 	'$(GHC_PKG)' --no-user-package-db -f $(LOCAL_PKGCONF005) register $(PKG005) -v0
 	#
 	"$(TEST_HC)" -c -dynamic f.c -o dir005/foo.o
@@ -115,7 +115,7 @@ ghcilink006 :
 	echo "id: test-XXX" >>$(PKG006)
 	echo "key: test-1.0" >>$(PKG006)
 	echo "extra-libraries: stdc++" >>$(PKG006)
-	echo "[]" >$(LOCAL_PKGCONF006)
+	'$(GHC_PKG)' init $(LOCAL_PKGCONF006)
 	'$(GHC_PKG)' --no-user-package-db -f $(LOCAL_PKGCONF006) register $(PKG006) -v0
 	#
 	echo ":q" | "$(TEST_HC)" --interactive -ignore-dot-ghci -v0 -package-db $(LOCAL_PKGCONF006) -package test
diff --git a/testsuite/tests/plugins/simple-plugin/Makefile b/testsuite/tests/plugins/simple-plugin/Makefile
index 17588bf..eb7cc6a 100644
--- a/testsuite/tests/plugins/simple-plugin/Makefile
+++ b/testsuite/tests/plugins/simple-plugin/Makefile
@@ -13,7 +13,7 @@ package.%:
 	mkdir pkg.$*
 	"$(TEST_HC)" -outputdir pkg.$* --make -v0 -o pkg.$*/setup Setup.hs
 	
-	echo "[]" > pkg.$*/local.package.conf
+	"$(GHC_PKG)" init pkg.$*/local.package.conf
 	
 	pkg.$*/setup configure --distdir pkg.$*/dist -v0 $(CABAL_PLUGIN_BUILD) --prefix="$(HERE)/pkg.$*/install" --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=pkg.$*/local.package.conf
 	pkg.$*/setup build     --distdir pkg.$*/dist -v0
diff --git a/testsuite/tests/rename/prog006/Makefile b/testsuite/tests/rename/prog006/Makefile
index 4124fec..e5d35e1 100644
--- a/testsuite/tests/rename/prog006/Makefile
+++ b/testsuite/tests/rename/prog006/Makefile
@@ -36,7 +36,8 @@ rn.prog006:
 	echo "key: test-1.0" >>pkg.conf
 	echo "import-dirs: `./pwd`" >>pkg.conf
 	echo "exposed-modules: B.C" >>pkg.conf
-	echo "[]" >$(LOCAL_PKGCONF)
+	rm -rf $(LOCAL_PKGCONF)
+	$(GHC_PKG) init $(LOCAL_PKGCONF)
 	$(LOCAL_GHC_PKG) register pkg.conf -v0
 	'$(TEST_HC)' $(TEST_HC_OPTS) -c -package-db $(LOCAL_PKGCONF) -package test -fforce-recomp A.hs -i
 # The -i clears the search path, so A.hs will find B.C from package test
diff --git a/testsuite/tests/simplCore/should_compile/T7702plugin/Makefile b/testsuite/tests/simplCore/should_compile/T7702plugin/Makefile
index 42c56c9..beba0dd 100644
--- a/testsuite/tests/simplCore/should_compile/T7702plugin/Makefile
+++ b/testsuite/tests/simplCore/should_compile/T7702plugin/Makefile
@@ -13,7 +13,7 @@ package.%:
 	mkdir pkg.$*
 	"$(TEST_HC)" -outputdir pkg.$* --make -v0 -o pkg.$*/setup Setup.hs
 
-	echo "[]" > pkg.$*/local.package.conf
+	"$(GHC_PKG)" init pkg.$*/local.package.conf
 
 	pkg.$*/setup configure --distdir pkg.$*/dist -v0 $(CABAL_PLUGIN_BUILD) --prefix="$(HERE)/pkg.$*/install" --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=pkg.$*/local.package.conf
 	pkg.$*/setup build     --distdir pkg.$*/dist -v0
diff --git a/testsuite/tests/typecheck/bug1465/Makefile b/testsuite/tests/typecheck/bug1465/Makefile
index c082cb6..78cdd51 100644
--- a/testsuite/tests/typecheck/bug1465/Makefile
+++ b/testsuite/tests/typecheck/bug1465/Makefile
@@ -11,7 +11,7 @@ clean:
 	rm -f v2/setup v2/Setup.o v2/Setup.hi
 	rm -rf v1/dist v2/dist
 	rm -f *.o *.hi
-	rm -f $(LOCAL_PKGCONF)
+	rm -rf $(LOCAL_PKGCONF)
 
 bug1465:
 	$(MAKE) clean
@@ -20,7 +20,7 @@ bug1465:
 	$(MAKE) clean
 
 prep:
-	echo "[]" >$(LOCAL_PKGCONF)
+	'$(GHC_PKG)' init $(LOCAL_PKGCONF)
 	$(MAKE) prep.v1
 	$(MAKE) prep.v2
 	'$(TEST_HC)' $(TEST_HC_OPTS) -package-db $(LOCAL_PKGCONF) -c -package $(PKG)-1.0 B1.hs



More information about the ghc-commits mailing list