Commit 6059c6b3 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Add more reexported module tests


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent d32d1458
......@@ -207,6 +207,11 @@ extra-source-files:
tests/PackageTests/PreProcessExtraSources/Foo.hsc
tests/PackageTests/PreProcessExtraSources/Main.hs
tests/PackageTests/PreProcessExtraSources/my.cabal
tests/PackageTests/ReexportedModules/containers-dupe/Data/Map.hs
tests/PackageTests/ReexportedModules/containers-dupe/containers-dupe.cabal
tests/PackageTests/ReexportedModules/p/fail-ambiguous.cabal
tests/PackageTests/ReexportedModules/p/fail-missing.cabal
tests/PackageTests/ReexportedModules/p/fail-other.cabal
tests/PackageTests/ReexportedModules/p/p.cabal
tests/PackageTests/ReexportedModules/q/A.hs
tests/PackageTests/ReexportedModules/q/q.cabal
......
name: containers-dupe
version: 0.1.0.0
license: BSD3
author: Edward Z. Yang
maintainer: ezyang@cs.stanford.edu
build-type: Simple
cabal-version: >=1.10
library
exposed-modules: Data.Map
build-depends: base
default-language: Haskell2010
name: p
version: 0.1.0.0
author: Edward Z. Yang
maintainer: ezyang@cs.stanford.edu
build-type: Simple
cabal-version: >=1.21
library
build-depends: base, containers, containers-dupe
reexported-modules: Data.Map as Map
name: p
version: 0.1.0.0
author: Edward Z. Yang
maintainer: ezyang@cs.stanford.edu
build-type: Simple
cabal-version: >=1.21
library
build-depends: base
reexported-modules: Missing as Foobar
name: p
version: 0.1.0.0
author: Edward Z. Yang
maintainer: ezyang@cs.stanford.edu
build-type: Simple
cabal-version: >=1.21
library
exposed-modules: Public
other-modules: Private
build-depends: base
reexported-modules: Private as Reprivate
......@@ -206,11 +206,25 @@ tests config = do
tc "OrderFlags" $ cabal_build []
-- Test that reexported modules build correctly
tc "ReexportedModules" . whenGhcVersion (>= mkVersion [7,9]) $ do
tcs "ReexportedModules" "p" . whenGhcVersion (>= mkVersion [7,9]) $ do
withPackageDb $ do
withPackage "p" $ cabal_install []
withPackage "p" $ cabal_install ["--cabal-file", "p.cabal"]
withPackage "q" $ do
cabal_build []
tcs "ReexportedModules" "fail-other" . whenGhcVersion (>= Version [7,9] []) $ do
withPackage "p" $ do
r <- shouldFail $ cabal' "configure" ["--cabal-file", "fail-other.cabal"]
assertOutputContains "Private" r
tcs "ReexportedModules" "fail-ambiguous" . whenGhcVersion (>= Version [7,9] []) $ do
withPackageDb $ do
withPackage "containers-dupe" $ cabal_install []
withPackage "p" $ do
r <- shouldFail $ cabal' "configure" ["--cabal-file", "fail-ambiguous.cabal"]
assertOutputContains "Data.Map" r
tcs "ReexportedModules" "fail-missing" . whenGhcVersion (>= Version [7,9] []) $ do
withPackage "p" $ do
r <- shouldFail $ cabal' "configure" ["--cabal-file", "fail-missing.cabal"]
assertOutputContains "Missing" r
-- Test that Cabal computes different IPIDs when the source changes.
tc "UniqueIPID" . withPackageDb $ do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment