diff options
Diffstat (limited to 'testsuite/tests')
9 files changed, 73 insertions, 0 deletions
diff --git a/testsuite/tests/backpack/cabal/bkpcabal06/.gitignore b/testsuite/tests/backpack/cabal/bkpcabal06/.gitignore new file mode 100644 index 0000000000..873250a6f8 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal06/.gitignore @@ -0,0 +1 @@ +impl/P.hs diff --git a/testsuite/tests/backpack/cabal/bkpcabal06/Makefile b/testsuite/tests/backpack/cabal/bkpcabal06/Makefile new file mode 100644 index 0000000000..29f1456e63 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal06/Makefile @@ -0,0 +1,27 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +SETUP='$(PWD)/Setup' -v0 +CONFIGURE=$(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db='$(PWD)/tmp.d' --prefix='$(PWD)/inst' + +# This test checks if recompilation works correctly when we change an +# hsig file which modifies the set of exported instances. Makes sure +# we track dependencies on instances from signatures correctly. + +bkpcabal06: clean + $(MAKE) -s --no-print-directory clean + '$(GHC_PKG)' init tmp.d + '$(TEST_HC)' -v0 --make Setup + $(CONFIGURE) + cp impl/P.hs.in1 impl/P.hs + $(SETUP) build + sleep 1 + cp impl/P.hs.in2 impl/P.hs + ! $(SETUP) build +ifneq "$(CLEANUP)" "" + $(MAKE) -s --no-print-directory clean +endif + +clean : + $(RM) -rf tmp.d inst dist Setup$(exeext) impl/P.hs diff --git a/testsuite/tests/backpack/cabal/bkpcabal06/Setup.hs b/testsuite/tests/backpack/cabal/bkpcabal06/Setup.hs new file mode 100644 index 0000000000..9a994af677 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal06/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/testsuite/tests/backpack/cabal/bkpcabal06/all.T b/testsuite/tests/backpack/cabal/bkpcabal06/all.T new file mode 100644 index 0000000000..26db90c976 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal06/all.T @@ -0,0 +1,9 @@ +if config.cleanup: + cleanup = 'CLEANUP=1' +else: + cleanup = 'CLEANUP=0' + +test('bkpcabal06', + extra_files(['bkpcabal06.cabal', 'Setup.hs', 'sig', 'impl']), + run_command, + ['$MAKE -s --no-print-directory bkpcabal06 ' + cleanup]) diff --git a/testsuite/tests/backpack/cabal/bkpcabal06/bkpcabal06.cabal b/testsuite/tests/backpack/cabal/bkpcabal06/bkpcabal06.cabal new file mode 100644 index 0000000000..7dfac20986 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal06/bkpcabal06.cabal @@ -0,0 +1,24 @@ +name: bkpcabal06 +version: 0.1.0.0 +license: BSD3 +author: Edward Z. Yang +maintainer: ezyang@cs.stanford.edu +build-type: Simple +cabal-version: >=1.10 + +library sig + signatures: P + reexported-modules: Prelude + build-depends: base + default-language: Haskell2010 + hs-source-dirs: sig + +library impl + exposed-modules: P + build-depends: base + default-language: Haskell2010 + hs-source-dirs: impl + +library + build-depends: sig, impl + default-language: Haskell2010 diff --git a/testsuite/tests/backpack/cabal/bkpcabal06/bkpcabal06.stderr b/testsuite/tests/backpack/cabal/bkpcabal06/bkpcabal06.stderr new file mode 100644 index 0000000000..8998e6555e --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal06/bkpcabal06.stderr @@ -0,0 +1,4 @@ + +sig/P.hsig:1:1: error: + • ‘p’ is exported by the hsig file, but not exported by the implementing module ‘z-bkpcabal06-z-impl-0.1.0.0:P’ + • while checking that z-bkpcabal06-z-impl-0.1.0.0:P implements signature P in bkpcabal06-0.1.0.0:sig[P=z-bkpcabal06-z-impl-0.1.0.0:P] diff --git a/testsuite/tests/backpack/cabal/bkpcabal06/impl/P.hs.in1 b/testsuite/tests/backpack/cabal/bkpcabal06/impl/P.hs.in1 new file mode 100644 index 0000000000..f0a4da313b --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal06/impl/P.hs.in1 @@ -0,0 +1,3 @@ +module P where +p :: Int +p = 3 diff --git a/testsuite/tests/backpack/cabal/bkpcabal06/impl/P.hs.in2 b/testsuite/tests/backpack/cabal/bkpcabal06/impl/P.hs.in2 new file mode 100644 index 0000000000..fc4877ad85 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal06/impl/P.hs.in2 @@ -0,0 +1 @@ +module P where diff --git a/testsuite/tests/backpack/cabal/bkpcabal06/sig/P.hsig b/testsuite/tests/backpack/cabal/bkpcabal06/sig/P.hsig new file mode 100644 index 0000000000..3c99ed9ed9 --- /dev/null +++ b/testsuite/tests/backpack/cabal/bkpcabal06/sig/P.hsig @@ -0,0 +1,2 @@ +signature P where +p :: Int |