Commit 178fb5e7 authored by Simon Marlow's avatar Simon Marlow
Browse files

Add a test for recompilation when a package version changes

parent 04c3e511
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
LOCAL_PKGCONF=local.package.conf
clean:
rm -f Setup$(exeext)
rm -rf a1/dist a2/dist b/dist
rm -f *.o *.hi
rm -f clean.out prep.out
rm -rf $(LOCAL_PKGCONF)
recomp007:
$(MAKE) clean
$(GHC_PKG) init $(LOCAL_PKGCONF)
"$(TEST_HC)" -v0 --make Setup.hs
$(MAKE) prep.a1
$(MAKE) prep.b
$(GHC_PKG) unregister --package-conf=$(LOCAL_PKGCONF) a-1.0
$(MAKE) prep.a2
cd b && ../Setup configure -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=../$(LOCAL_PKGCONF)
cd b && ../Setup build
prep.%:
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
import Distribution.Simple
main = defaultMain
name: a
version: 1.0
exposed-modules: A
build-depends: base
build-type: Simple
ghc-options: -O0
name: a
version: 2.0
exposed-modules: A
build-depends: base
build-type: Simple
ghc-options: -O0
# This tests for correct recompilation when a package version changes.
# See the patch
# "Fix a recompilation checking bug when a package dependency changes"
test('recomp007',
[ skip_if_fast, clean_cmd('$MAKE -s clean') ],
run_command,
['$MAKE -s --no-print-directory recomp007'])
module Main (main) where
import B
main = print b
name: b
version: 1.0
build-type: Simple
cabal-version: >= 1.2
executable test {
build-depends: base, a
main-is: Main.hs
other-modules: B
ghc-options: -O0
}
[1 of 2] Compiling B ( B.hs, dist/build/test/test-tmp/B.o )
[2 of 2] Compiling Main ( Main.hs, dist/build/test/test-tmp/Main.o )
Linking dist/build/test/test ...
Preprocessing executables for b-1.0...
Building b-1.0...
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