Skip to content

Commit 52bc2ee

Browse files
committed
Add a test for haskell#3199.
(cherry picked from commit d70c9aa)
1 parent acb6d2d commit 52bc2ee

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

cabal-install/cabal-install.cabal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ Extra-Source-Files:
8484
tests/IntegrationTests/new-build/monitor_cabal_files/q/Setup.hs
8585
tests/IntegrationTests/new-build/monitor_cabal_files/q/q-broken.cabal.in
8686
tests/IntegrationTests/new-build/monitor_cabal_files/q/q-fixed.cabal.in
87+
tests/IntegrationTests/regression/t3199.sh
88+
tests/IntegrationTests/regression/t3199/Main.hs
89+
tests/IntegrationTests/regression/t3199/Setup.hs
90+
tests/IntegrationTests/regression/t3199/test-3199.cabal
8791
tests/IntegrationTests/sandbox-sources/fail_removing_source_thats_not_registered.err
8892
tests/IntegrationTests/sandbox-sources/fail_removing_source_thats_not_registered.sh
8993
tests/IntegrationTests/sandbox-sources/p/Setup.hs
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
. ./common.sh
2+
3+
if [[ `ghc --numeric-version` =~ "7\\." ]]; then
4+
cd t3199
5+
tmpfile=$(mktemp /tmp/cabal-t3199.XXXXXX)
6+
cabal sandbox init
7+
cabal sandbox add-source ../../../../../Cabal
8+
cabal install --package-db=clear --package-db=global --only-dep --dry-run > $tmpfile
9+
grep -q "the following would be installed" $tmpfile || die "Should've installed Cabal"
10+
grep -q Cabal $tmpfile || die "Should've installed Cabal"
11+
rm $tmpfile
12+
fi
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Main where
2+
3+
main :: IO ()
4+
main = putStrLn "Hello, Haskell!"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: test-t3199
2+
version: 0.1.0.0
3+
license: BSD3
4+
author: Mikhail Glushenkov
5+
maintainer: [email protected]
6+
category: Test
7+
build-type: Custom
8+
cabal-version: >=1.10
9+
10+
flag exe_2
11+
description: Build second exe
12+
default: False
13+
14+
executable test-3199-1
15+
main-is: Main.hs
16+
build-depends: base
17+
default-language: Haskell2010
18+
19+
executable test-3199-2
20+
main-is: Main.hs
21+
build-depends: base, ansi-terminal
22+
default-language: Haskell2010
23+
24+
if flag(exe_2)
25+
buildable: True
26+
else
27+
buildable: False

0 commit comments

Comments
 (0)