Change testsuite to not use old-style file package databases
authorDuncan Coutts <duncan@well-typed.com>
Wed, 27 Aug 2014 15:33:20 +0000 (16:33 +0100)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Fri, 29 Aug 2014 14:03:33 +0000 (15:03 +0100)
Now uses ghc-pkg init. The file-style databases are no longer supported.

testsuite/tests/driver/T1372/Makefile
testsuite/tests/driver/T3007/Makefile
testsuite/tests/ghci/linking/Makefile
testsuite/tests/plugins/simple-plugin/Makefile
testsuite/tests/rename/prog006/Makefile
testsuite/tests/simplCore/should_compile/T7702plugin/Makefile
testsuite/tests/typecheck/bug1465/Makefile

index 91ef6d5..acd6b66 100644 (file)
@@ -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
index 7161225..8b78a49 100644 (file)
@@ -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
index 08c5158..5b8e23c 100644 (file)
@@ -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
index 17588bf..eb7cc6a 100644 (file)
@@ -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
index 4124fec..e5d35e1 100644 (file)
@@ -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
index 42c56c9..beba0dd 100644 (file)
@@ -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
index c082cb6..78cdd51 100644 (file)
@@ -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