summaryrefslogtreecommitdiff
path: root/testsuite/tests/cabal/cabal03
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/cabal/cabal03')
-rw-r--r--testsuite/tests/cabal/cabal03/Makefile41
-rw-r--r--testsuite/tests/cabal/cabal03/Setup.lhs2
-rw-r--r--testsuite/tests/cabal/cabal03/all.T9
-rw-r--r--testsuite/tests/cabal/cabal03/p/P.hs3
-rw-r--r--testsuite/tests/cabal/cabal03/p/p.cabal5
-rw-r--r--testsuite/tests/cabal/cabal03/q/q.cabal5
-rw-r--r--testsuite/tests/cabal/cabal03/r/r.cabal5
7 files changed, 70 insertions, 0 deletions
diff --git a/testsuite/tests/cabal/cabal03/Makefile b/testsuite/tests/cabal/cabal03/Makefile
new file mode 100644
index 0000000000..b5520e3d08
--- /dev/null
+++ b/testsuite/tests/cabal/cabal03/Makefile
@@ -0,0 +1,41 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+# SETUP=../Setup
+SETUP=../Setup -v0
+
+# This test is for overlapping/shadowing packages with Cabal. We
+# 1. install p-1.0 to the global DB
+# 2. install q-1.0 (depending on p-1.0) to a temporary DB
+# 3. install a differnet p-1.0 to the temp DB
+# 4. attempt to configure and buidl r, which depends on p-1.0 and q-1.0
+#
+# step 4 will elicit a warning from Cabal's configure step that the
+# packages are inconsistent, and will cause an error from GHC.
+# Currently the error message from GHC is swallowed by Cabal.
+
+cabal03: clean
+ $(MAKE) clean
+ '$(GHC_PKG)' init tmp.d
+ '$(TEST_HC)' -v0 --make Setup
+ cd p && $(SETUP) clean
+ cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --disable-optimisation --ghc-pkg-option=--force
+ cd p && $(SETUP) build
+ cd p && $(SETUP) register
+ cd q && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
+ cd q && $(SETUP) build
+ cd q && $(SETUP) register
+ cd p && $(SETUP) clean
+ cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
+ cd p && $(SETUP) build
+ cd p && $(SETUP) register
+ cd r && ! ../Setup configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d --ghc-pkg-option=--force
+ifneq "$(CLEANUP)" ""
+ $(MAKE) clean
+endif
+
+clean :
+ '$(GHC_PKG)' unregister --force p >/dev/null 2>&1 || true
+ '$(GHC_PKG)' unregister --force q >/dev/null 2>&1 || true
+ $(RM) -r tmp.d *.o *.hi */*.o */*.hi */Setup$(exeext) */dist Setup$(exeext)
diff --git a/testsuite/tests/cabal/cabal03/Setup.lhs b/testsuite/tests/cabal/cabal03/Setup.lhs
new file mode 100644
index 0000000000..b2dccbe310
--- /dev/null
+++ b/testsuite/tests/cabal/cabal03/Setup.lhs
@@ -0,0 +1,2 @@
+> import Distribution.Simple
+> main = defaultMain
diff --git a/testsuite/tests/cabal/cabal03/all.T b/testsuite/tests/cabal/cabal03/all.T
new file mode 100644
index 0000000000..01d3882a84
--- /dev/null
+++ b/testsuite/tests/cabal/cabal03/all.T
@@ -0,0 +1,9 @@
+if default_testopts.cleanup != '':
+ cleanup = 'CLEANUP=1'
+else:
+ cleanup = ''
+
+test('cabal03',
+ ignore_output,
+ run_command,
+ ['$MAKE -s --no-print-directory cabal03 ' + cleanup])
diff --git a/testsuite/tests/cabal/cabal03/p/P.hs b/testsuite/tests/cabal/cabal03/p/P.hs
new file mode 100644
index 0000000000..801fa390bd
--- /dev/null
+++ b/testsuite/tests/cabal/cabal03/p/P.hs
@@ -0,0 +1,3 @@
+module P (p) where
+p = ()
+
diff --git a/testsuite/tests/cabal/cabal03/p/p.cabal b/testsuite/tests/cabal/cabal03/p/p.cabal
new file mode 100644
index 0000000000..5ef93a0b92
--- /dev/null
+++ b/testsuite/tests/cabal/cabal03/p/p.cabal
@@ -0,0 +1,5 @@
+name: p
+version: 1.0
+exposed-modules: P
+build-depends: base
+build-type: Simple
diff --git a/testsuite/tests/cabal/cabal03/q/q.cabal b/testsuite/tests/cabal/cabal03/q/q.cabal
new file mode 100644
index 0000000000..691e60b623
--- /dev/null
+++ b/testsuite/tests/cabal/cabal03/q/q.cabal
@@ -0,0 +1,5 @@
+name: q
+version: 1.0
+build-depends: p
+exposed-modules:
+build-type: Simple
diff --git a/testsuite/tests/cabal/cabal03/r/r.cabal b/testsuite/tests/cabal/cabal03/r/r.cabal
new file mode 100644
index 0000000000..b874bb4e15
--- /dev/null
+++ b/testsuite/tests/cabal/cabal03/r/r.cabal
@@ -0,0 +1,5 @@
+name: r
+version: 1.0
+build-depends: p, q
+exposed-modules:
+build-type: Simple