Commit 6ba2f7ad authored by Ian Lynagh's avatar Ian Lynagh

Make 1372 use a local package database

Eliminates random failures when it's run in parallel with other tests
parent 73557b0c
......@@ -2,6 +2,8 @@ TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
LOCAL_PKGCONF=local.package.conf
clean:
rm -f p1/setup p1/Setup.o p1/Setup.hi
rm -f p2/setup p2/Setup.o p2/Setup.hi
......@@ -9,27 +11,27 @@ clean:
rm -f *.o *.hi
rm -f clean.out prep.out
rm -f p1/A.hs
-"$(GHC_PKG)" unregister p1
-"$(GHC_PKG)" unregister p2
rm -f $(LOCAL_PKGCONF)
# We aren't interested in the output from the cabal & compilation
# stages, so redirect it to a file.
1372:
$(MAKE) clean 1>clean.out 2>clean.out
$(MAKE) prep 1>prep.out 2>prep.out
$(MAKE) clean
$(MAKE) prep
# This should recompile Main.hs, because A in package p1 has changed
# and recompiling Main.hs will now fail.
@(cd p2 && ./setup build -v0) || exit 0
$(MAKE) clean 1>>clean.out 2>>clean.out
-cd p2 && ./setup build -v0
$(MAKE) clean
prep:
echo "[]" >$(LOCAL_PKGCONF)
cp p1/A1.hs p1/A.hs
for i in p1 p2; do \
(cd $$i && \
"$(TEST_HC)" --make -o setup Setup.hs && \
./setup configure -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" && \
./setup build && \
./setup register --inplace ); done
$(MAKE) prep.p1
$(MAKE) prep.p2
cp p1/A2.hs p1/A.hs
(cd p1 && ./setup build)
cd p1 && ./setup build -v0
prep.%:
cd $* && "$(TEST_HC)" -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 build -v0
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