testsuite: Add testcase for #13168
authorBen Gamari <ben@smart-cactus.org>
Sun, 23 Jul 2017 17:15:22 +0000 (13:15 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 25 Jul 2017 01:06:13 +0000 (21:06 -0400)
Thanks to Ryan Scott for the testcase.

Currently broken.

testsuite/tests/typecheck/T13168/Makefile [new file with mode: 0644]
testsuite/tests/typecheck/T13168/Setup.hs [new file with mode: 0644]
testsuite/tests/typecheck/T13168/T13168.script [new file with mode: 0644]
testsuite/tests/typecheck/T13168/T13168.stderr [new file with mode: 0644]
testsuite/tests/typecheck/T13168/T13168.stdout [new file with mode: 0644]
testsuite/tests/typecheck/T13168/all.T [new file with mode: 0644]
testsuite/tests/typecheck/T13168/package1/DuplicateModuleName.hs [new file with mode: 0644]
testsuite/tests/typecheck/T13168/package1/package1.cabal [new file with mode: 0644]
testsuite/tests/typecheck/T13168/package2/DuplicateModuleName.hs [new file with mode: 0644]
testsuite/tests/typecheck/T13168/package2/package2.cabal [new file with mode: 0644]

diff --git a/testsuite/tests/typecheck/T13168/Makefile b/testsuite/tests/typecheck/T13168/Makefile
new file mode 100644 (file)
index 0000000..4dc9d7b
--- /dev/null
@@ -0,0 +1,19 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+SETUP=../Setup -v0
+CONFIGURE=$(SETUP) configure --with-ghc='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS)' --package-db='$(PWD)/tmp.d' --prefix='$(PWD)/inst'
+
+T13168: clean
+       $(MAKE) -s --no-print-directory clean
+       '$(GHC_PKG)' init tmp.d
+       '$(TEST_HC)' -v0 --make Setup
+
+       cd package1 && $(CONFIGURE) && $(SETUP) build && $(SETUP) copy && $(SETUP) register
+       cd package2 && $(CONFIGURE) && $(SETUP) build && $(SETUP) copy && $(SETUP) register
+
+       '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -package-db tmp.d < T13168.script
+
+clean :
+       $(RM) -r tmp.d inst dist Setup$(exeext)
diff --git a/testsuite/tests/typecheck/T13168/Setup.hs b/testsuite/tests/typecheck/T13168/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/typecheck/T13168/T13168.script b/testsuite/tests/typecheck/T13168/T13168.script
new file mode 100644 (file)
index 0000000..6fa3215
--- /dev/null
@@ -0,0 +1,3 @@
+:set -XPackageImports
+import "package1" DuplicateModuleName
+Window
diff --git a/testsuite/tests/typecheck/T13168/T13168.stderr b/testsuite/tests/typecheck/T13168/T13168.stderr
new file mode 100644 (file)
index 0000000..e69dbaa
--- /dev/null
@@ -0,0 +1,4 @@
+Warning: -rtsopts and -with-rtsopts have no effect with -shared.
+    Call hs_init_ghc() from your main() function to set these options.
+Warning: -rtsopts and -with-rtsopts have no effect with -shared.
+    Call hs_init_ghc() from your main() function to set these options.
diff --git a/testsuite/tests/typecheck/T13168/T13168.stdout b/testsuite/tests/typecheck/T13168/T13168.stdout
new file mode 100644 (file)
index 0000000..a935d2f
--- /dev/null
@@ -0,0 +1 @@
+Window
diff --git a/testsuite/tests/typecheck/T13168/all.T b/testsuite/tests/typecheck/T13168/all.T
new file mode 100644 (file)
index 0000000..8552366
--- /dev/null
@@ -0,0 +1,4 @@
+test('T13168',
+     [extra_files(['package1', 'package2', 'Setup.hs']), expect_broken(13168)],
+     run_command,
+     ['$MAKE -s --no-print-directory T13168'])
diff --git a/testsuite/tests/typecheck/T13168/package1/DuplicateModuleName.hs b/testsuite/tests/typecheck/T13168/package1/DuplicateModuleName.hs
new file mode 100644 (file)
index 0000000..84a32b2
--- /dev/null
@@ -0,0 +1,3 @@
+module DuplicateModuleName (Window(..)) where
+
+data Window = Window deriving (Show)
diff --git a/testsuite/tests/typecheck/T13168/package1/package1.cabal b/testsuite/tests/typecheck/T13168/package1/package1.cabal
new file mode 100644 (file)
index 0000000..543fc10
--- /dev/null
@@ -0,0 +1,11 @@
+name:                package1
+version:             0.1.0.0
+license:             BSD3
+build-type:          Simple
+cabal-version:       >=1.10
+
+library
+  exposed-modules:     DuplicateModuleName
+  build-depends:       base >= 4.3 && < 5
+  default-language:    Haskell2010
+  ghc-options:         -Wall
diff --git a/testsuite/tests/typecheck/T13168/package2/DuplicateModuleName.hs b/testsuite/tests/typecheck/T13168/package2/DuplicateModuleName.hs
new file mode 100644 (file)
index 0000000..91c65b5
--- /dev/null
@@ -0,0 +1,3 @@
+module DuplicateModuleName (Window(..)) where
+
+data Window = Window
diff --git a/testsuite/tests/typecheck/T13168/package2/package2.cabal b/testsuite/tests/typecheck/T13168/package2/package2.cabal
new file mode 100644 (file)
index 0000000..ea40c9d
--- /dev/null
@@ -0,0 +1,12 @@
+name:                package2
+version:             0.1.0.0
+license:             BSD3
+build-type:          Simple
+cabal-version:       >=1.10
+
+library
+  exposed-modules:     DuplicateModuleName
+  build-depends:       base >= 4.3 && < 5
+  default-language:    Haskell2010
+  ghc-options:         -Wall
+