Skip to content

Commit

Permalink
Test for haskell#960
Browse files Browse the repository at this point in the history
Added a test for the problem where a library package has a testsuite
that depends on a packge that depends on it. We should be able to handle
this by having separate build plans for the library and its testsuite.

The ticket for separate build plans is haskell#1575
  • Loading branch information
enolan committed Oct 23, 2015
1 parent 3923101 commit 9993980
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module A where

a :: ()
a = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: a
version: 0.1.0.0
license: BSD3
license-file: LICENSE
author: Echo Nolan
category: TestSuite
build-type: Simple
cabal-version: >=1.10

library
exposed-modules: A
build-depends: base
default-language: Haskell2010

Test-Suite tests
type: exitcode-stdio-1.0
main-is: test.hs
build-depends: b
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module B where

b :: ()
b = ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: b
version: 0.1.0.0
license: BSD3
license-file: LICENSE
author: Echo Nolan
category: TestSuite
build-type: Simple
cabal-version: >=1.10

library
exposed-modules: B
build-depends: base, a
default-language: Haskell2010
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Helper to run Cabal
cabal() {
$CABAL $CABAL_ARGS "$@"
}

die() {
echo "die: $@"
exit 1
}

cabal sandbox init
cabal sandbox add-source a
cabal sandbox add-source b
cabal install --enable-tests a

0 comments on commit 9993980

Please sign in to comment.