diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index ff6b26b9c65..d13a572cec8 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -84,6 +84,11 @@ Extra-Source-Files: tests/IntegrationTests/new-build/monitor_cabal_files/q/Setup.hs tests/IntegrationTests/new-build/monitor_cabal_files/q/q-broken.cabal.in tests/IntegrationTests/new-build/monitor_cabal_files/q/q-fixed.cabal.in + tests/IntegrationTests/regression/common.sh + tests/IntegrationTests/regression/t3199.sh + tests/IntegrationTests/regression/t3199/Main.hs + tests/IntegrationTests/regression/t3199/Setup.hs + tests/IntegrationTests/regression/t3199/test-3199.cabal tests/IntegrationTests/sandbox-sources/fail_removing_source_thats_not_registered.err tests/IntegrationTests/sandbox-sources/fail_removing_source_thats_not_registered.sh tests/IntegrationTests/sandbox-sources/p/Setup.hs diff --git a/cabal-install/tests/IntegrationTests/regression/t3199.sh b/cabal-install/tests/IntegrationTests/regression/t3199.sh new file mode 100644 index 00000000000..f6b4244fc7f --- /dev/null +++ b/cabal-install/tests/IntegrationTests/regression/t3199.sh @@ -0,0 +1,12 @@ +. ./common.sh + +if [[ `ghc --numeric-version` =~ "7\\." ]]; then + cd t3199 + tmpfile=$(mktemp /tmp/cabal-t3199.XXXXXX) + cabal sandbox init + cabal sandbox add-source ../../../../../Cabal + cabal install --package-db=clear --package-db=global --only-dep --dry-run > $tmpfile + grep -q "the following would be installed" $tmpfile || die "Should've installed Cabal" + grep -q Cabal $tmpfile || die "Should've installed Cabal" + rm $tmpfile +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