Skip to content

Commit

Permalink
Test for issue haskell#3436.
Browse files Browse the repository at this point in the history
  • Loading branch information
grayjay committed Aug 28, 2016
1 parent 77fb0b9 commit 9ec4028
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cabal-install/cabal-install.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ Extra-Source-Files:
-- Do NOT edit this section manually; instead, run the script.
-- BEGIN gen-extra-source-files
tests/IntegrationTests/common.sh
tests/IntegrationTests/custom-setup/Cabal-99998/Cabal.cabal
tests/IntegrationTests/custom-setup/Cabal-99998/CabalMessage.hs
tests/IntegrationTests/custom-setup/Cabal-99999/Cabal.cabal
tests/IntegrationTests/custom-setup/Cabal-99999/CabalMessage.hs
tests/IntegrationTests/custom-setup/custom-setup/Setup.hs
tests/IntegrationTests/custom-setup/custom-setup/custom-setup.cabal
tests/IntegrationTests/custom-setup/installs_Cabal_as_setup_dep.sh
tests/IntegrationTests/custom/custom_dep.sh
tests/IntegrationTests/custom/custom_dep/client/B.hs
tests/IntegrationTests/custom/custom_dep/client/Setup.hs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Cabal
version: 99998
build-type: Simple
cabal-version: >= 1.2

library
build-depends: base
exposed-modules: CabalMessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module CabalMessage where

message = "This is Cabal-99998"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Cabal
version: 99999
build-type: Simple
cabal-version: >= 1.2

library
build-depends: base
exposed-modules: CabalMessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module CabalMessage where

message = "This is Cabal-99999"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import CabalMessage (message)
import System.Exit
import System.IO

main = hPutStrLn stderr message >> exitFailure
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: custom-setup
version: 1.0
build-type: Custom
cabal-version: >= 99999

custom-setup
setup-depends: base, Cabal >= 99999

library
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Regression test for issue #3436

. ./common.sh
cabal sandbox init
cabal install ./Cabal-99998
cabal sandbox add-source Cabal-99999

# Install custom-setup, which has a setup dependency on Cabal-99999.
# cabal should build the setup script with Cabal-99999, but then
# configure should fail because Setup just prints an error message
# imported from Cabal and exits.
! cabal install custom-setup/ > output 2>&1

cat output
grep -q "This is Cabal-99999" output || die "Expected output from Cabal-99999"

0 comments on commit 9ec4028

Please sign in to comment.