Skip to content

Commit

Permalink
Add a test for haskell#3199.
Browse files Browse the repository at this point in the history
(cherry picked from commit d70c9aa)
  • Loading branch information
23Skidoo committed Apr 19, 2016
1 parent acb6d2d commit 7054ade
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions cabal-install/tests/IntegrationTests/regression/t3199.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions cabal-install/tests/IntegrationTests/regression/t3199/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Main where

main :: IO ()
main = putStrLn "Hello, Haskell!"
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,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

0 comments on commit 7054ade

Please sign in to comment.