Commit 4eb8e4f2 authored by kristenk's avatar kristenk
Browse files

Test configuring a package with a custom-setup that doesn't include Cabal.

parent 9ec40287
......@@ -27,8 +27,14 @@ Extra-Source-Files:
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-without-cabal-defaultMain/Setup.hs
tests/IntegrationTests/custom-setup/custom-setup-without-cabal-defaultMain/custom-setup-without-cabal-defaultMain.cabal
tests/IntegrationTests/custom-setup/custom-setup-without-cabal/Setup.hs
tests/IntegrationTests/custom-setup/custom-setup-without-cabal/custom-setup-without-cabal.cabal
tests/IntegrationTests/custom-setup/custom-setup/Setup.hs
tests/IntegrationTests/custom-setup/custom-setup/custom-setup.cabal
tests/IntegrationTests/custom-setup/custom_setup_without_Cabal_doesnt_allow_Cabal_import.sh
tests/IntegrationTests/custom-setup/custom_setup_without_Cabal_doesnt_require_Cabal.sh
tests/IntegrationTests/custom-setup/installs_Cabal_as_setup_dep.sh
tests/IntegrationTests/custom/custom_dep.sh
tests/IntegrationTests/custom/custom_dep/client/B.hs
......
name: custom-setup-without-cabal-defaultMain
version: 1.0
build-type: Custom
cabal-version: >= 1.2
custom-setup
setup-depends: base
library
import System.Exit
import System.IO
main = hPutStrLn stderr "My custom Setup" >> exitFailure
name: custom-setup-without-cabal
version: 1.0
build-type: Custom
cabal-version: >= 99999
custom-setup
setup-depends: base
library
. ./common.sh
cd custom-setup-without-cabal-defaultMain
# This package has explicit setup dependencies that do not include Cabal.
# Compilation should fail because Setup.hs imports Distribution.Simple.
! cabal new-build custom-setup-without-cabal-defaultMain > output 2>&1
cat output
grep -q "\(Could not find module\|Failed to load interface for\).*Distribution\\.Simple" output \
|| die "Should not have been able to import Cabal"
grep -q "It is a member of the hidden package .*Cabal-" output \
|| die "Cabal should be available"
. ./common.sh
cd custom-setup-without-cabal
# This package has explicit setup dependencies that do not include Cabal.
# new-build should try to build it, even though the cabal-version cannot be
# satisfied by an installed version of Cabal (cabal-version: >= 99999). However,
# configure should fail because Setup.hs just prints an error message and exits.
! cabal new-build custom-setup-without-cabal > output 2>&1
cat output
grep -q "My custom Setup" output \
|| die "Expected output from custom Setup"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment