[commit: ghc] master: testsuite: Add testcase for #13168 (8ec7770)
git at git.haskell.org
git at git.haskell.org
Tue Jul 25 01:06:57 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/8ec7770886a23da86e59ddfa112dcc6b050d088c/ghc
>---------------------------------------------------------------
commit 8ec7770886a23da86e59ddfa112dcc6b050d088c
Author: Ben Gamari <ben at smart-cactus.org>
Date: Sun Jul 23 13:15:22 2017 -0400
testsuite: Add testcase for #13168
Thanks to Ryan Scott for the testcase.
Currently broken.
>---------------------------------------------------------------
8ec7770886a23da86e59ddfa112dcc6b050d088c
testsuite/tests/typecheck/T13168/Makefile | 19 +++++++++++++++++++
.../cabal/bkpcabal01 => typecheck/T13168}/Setup.hs | 0
testsuite/tests/typecheck/T13168/T13168.script | 3 +++
testsuite/tests/typecheck/T13168/T13168.stderr | 4 ++++
testsuite/tests/typecheck/T13168/T13168.stdout | 1 +
testsuite/tests/typecheck/T13168/all.T | 4 ++++
.../typecheck/T13168/package1/DuplicateModuleName.hs | 3 +++
.../tests/typecheck/T13168/package1/package1.cabal | 11 +++++++++++
.../typecheck/T13168/package2/DuplicateModuleName.hs | 3 +++
.../tests/typecheck/T13168/package2/package2.cabal | 12 ++++++++++++
10 files changed, 60 insertions(+)
diff --git a/testsuite/tests/typecheck/T13168/Makefile b/testsuite/tests/typecheck/T13168/Makefile
new file mode 100644
index 0000000..4dc9d7b
--- /dev/null
+++ b/testsuite/tests/typecheck/T13168/Makefile
@@ -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/backpack/cabal/bkpcabal01/Setup.hs b/testsuite/tests/typecheck/T13168/Setup.hs
similarity index 100%
copy from testsuite/tests/backpack/cabal/bkpcabal01/Setup.hs
copy to testsuite/tests/typecheck/T13168/Setup.hs
diff --git a/testsuite/tests/typecheck/T13168/T13168.script b/testsuite/tests/typecheck/T13168/T13168.script
new file mode 100644
index 0000000..6fa3215
--- /dev/null
+++ b/testsuite/tests/typecheck/T13168/T13168.script
@@ -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
index 0000000..e69dbaa
--- /dev/null
+++ b/testsuite/tests/typecheck/T13168/T13168.stderr
@@ -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
index 0000000..a935d2f
--- /dev/null
+++ b/testsuite/tests/typecheck/T13168/T13168.stdout
@@ -0,0 +1 @@
+Window
diff --git a/testsuite/tests/typecheck/T13168/all.T b/testsuite/tests/typecheck/T13168/all.T
new file mode 100644
index 0000000..8552366
--- /dev/null
+++ b/testsuite/tests/typecheck/T13168/all.T
@@ -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
index 0000000..84a32b2
--- /dev/null
+++ b/testsuite/tests/typecheck/T13168/package1/DuplicateModuleName.hs
@@ -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
index 0000000..543fc10
--- /dev/null
+++ b/testsuite/tests/typecheck/T13168/package1/package1.cabal
@@ -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
index 0000000..91c65b5
--- /dev/null
+++ b/testsuite/tests/typecheck/T13168/package2/DuplicateModuleName.hs
@@ -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
index 0000000..ea40c9d
--- /dev/null
+++ b/testsuite/tests/typecheck/T13168/package2/package2.cabal
@@ -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
+
More information about the ghc-commits
mailing list