Fix bug where reexports of wired-in packages don't work.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Mon, 29 Feb 2016 10:53:34 +0000 (11:53 +0100)
committerBen Gamari <ben@smart-cactus.org>
Mon, 29 Feb 2016 12:42:52 +0000 (13:42 +0100)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: hvr, bgamari, austin

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1926

GHC Trac Issues: #11589

testsuite/tests/cabal/cabal09/Main.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal09/Makefile [new file with mode: 0644]
testsuite/tests/cabal/cabal09/Setup.hs [new file with mode: 0644]
testsuite/tests/cabal/cabal09/all.T [new file with mode: 0644]
testsuite/tests/cabal/cabal09/reexport.cabal [new file with mode: 0644]

diff --git a/testsuite/tests/cabal/cabal09/Main.hs b/testsuite/tests/cabal/cabal09/Main.hs
new file mode 100644 (file)
index 0000000..eabafdf
--- /dev/null
@@ -0,0 +1,2 @@
+import Data.List.NonEmpty
+main = return ()
diff --git a/testsuite/tests/cabal/cabal09/Makefile b/testsuite/tests/cabal/cabal09/Makefile
new file mode 100644 (file)
index 0000000..e89c2ea
--- /dev/null
@@ -0,0 +1,21 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+SETUP = ./Setup -v0
+
+# This test is for package reexports from a wired-in package,
+# which had a bug
+
+cabal09: clean
+       $(MAKE) clean
+       '$(TEST_HC)' -v0 --make Setup
+       $(SETUP) clean
+       $(SETUP) configure $(CABAL_MINIMAL_BUILD) --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)'
+       $(SETUP) build
+ifneq "$(CLEANUP)" ""
+       $(MAKE) clean
+endif
+
+clean :
+       $(RM) -r */dist Setup$(exeext) *.o *.hi
diff --git a/testsuite/tests/cabal/cabal09/Setup.hs b/testsuite/tests/cabal/cabal09/Setup.hs
new file mode 100644 (file)
index 0000000..9a994af
--- /dev/null
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/testsuite/tests/cabal/cabal09/all.T b/testsuite/tests/cabal/cabal09/all.T
new file mode 100644 (file)
index 0000000..66bdb01
--- /dev/null
@@ -0,0 +1,9 @@
+if default_testopts.cleanup != '':
+   cleanup = 'CLEANUP=1'
+else:
+   cleanup = ''
+
+test('cabal09',
+     ignore_output,
+     run_command,
+     ['$MAKE -s --no-print-directory cabal09 ' + cleanup])
diff --git a/testsuite/tests/cabal/cabal09/reexport.cabal b/testsuite/tests/cabal/cabal09/reexport.cabal
new file mode 100644 (file)
index 0000000..447a3ee
--- /dev/null
@@ -0,0 +1,20 @@
+-- Initial reexport.cabal generated by cabal init.  For further
+-- documentation, see http://haskell.org/cabal/users-guide/
+
+name:                reexport
+version:             0.1.0.0
+license:             BSD3
+author:              Edward Z. Yang
+maintainer:          ezyang@cs.stanford.edu
+build-type:          Simple
+cabal-version:       >=1.23
+
+library
+  reexported-modules:  Data.List.NonEmpty
+  build-depends:       base >=4.9 && <4.10
+  default-language:    Haskell2010
+
+executable foo
+  main-is: Main.hs
+  build-depends: base, reexport
+  default-language:    Haskell2010