Commit 282d7378 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Port custom-setup/custom_setup_without_Cabal_doesnt_allow_Cabal_import to new test suite



Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent ca95eb89
. ./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"
import Test.Cabal.Prelude
main = cabalTest $ do
r <- fails $ cabal' "new-build" []
assertRegex "Should not have been able to import Cabal"
"(Could not find module|Failed to load interface for).*Distribution\\.Simple" r
-- When using --with-ghc, this message is not necessarily output
has_cabal <- hasCabalForGhc
when has_cabal $
assertRegex "It is a member of the hidden package .*Cabal-"
"It is a member of the hidden package" r
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