diff --git a/cabal-install/tests/IntegrationTests/regression/common.sh b/cabal-install/tests/IntegrationTests/regression/common.sh new file mode 100644 index 00000000000..f2b18b51d52 --- /dev/null +++ b/cabal-install/tests/IntegrationTests/regression/common.sh @@ -0,0 +1,9 @@ +# Helper to run Cabal +cabal() { + "$CABAL" $CABAL_ARGS "$@" +} + +die() { + echo "die: $@" + exit 1 +} diff --git a/cabal-install/tests/IntegrationTests/regression/t3199.sh b/cabal-install/tests/IntegrationTests/regression/t3199.sh new file mode 100644 index 00000000000..35c1ba601c6 --- /dev/null +++ b/cabal-install/tests/IntegrationTests/regression/t3199.sh @@ -0,0 +1,9 @@ +. ./common.sh + +if [[ `ghc --numeric-version` =~ "7\\." ]]; then + cd t3199 + cabal sandbox init + cabal sandbox add-source ../../../../../Cabal + cabal install --package-db=clear --package-db=global --only-dep --dry-run \ + | grep -q Cabal || die "Should've installed Cabal" +fi diff --git a/cabal-install/tests/IntegrationTests/regression/t3199/Main.hs b/cabal-install/tests/IntegrationTests/regression/t3199/Main.hs new file mode 100644 index 00000000000..65ae4a05d5d --- /dev/null +++ b/cabal-install/tests/IntegrationTests/regression/t3199/Main.hs @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = putStrLn "Hello, Haskell!" diff --git a/cabal-install/tests/IntegrationTests/regression/t3199/Setup.hs b/cabal-install/tests/IntegrationTests/regression/t3199/Setup.hs new file mode 100644 index 00000000000..9a994af677b --- /dev/null +++ b/cabal-install/tests/IntegrationTests/regression/t3199/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/cabal-install/tests/IntegrationTests/regression/t3199/test-3199.cabal b/cabal-install/tests/IntegrationTests/regression/t3199/test-3199.cabal new file mode 100644 index 00000000000..93e94c20bbb --- /dev/null +++ b/cabal-install/tests/IntegrationTests/regression/t3199/test-3199.cabal @@ -0,0 +1,27 @@ +name: test-t3199 +version: 0.1.0.0 +license: BSD3 +author: Mikhail Glushenkov +maintainer: mikhail.glushenkov@gmail.com +category: Test +build-type: Custom +cabal-version: >=1.10 + +flag exe_2 + description: Build second exe + default: False + +executable test-3199-1 + main-is: Main.hs + build-depends: base + default-language: Haskell2010 + +executable test-3199-2 + main-is: Main.hs + build-depends: base, ansi-terminal + default-language: Haskell2010 + + if flag(exe_2) + buildable: True + else + buildable: False