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

Port exec/configures_ghc_to_use_sandbox to new test suite.



Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 158cc06e
. ./common.sh
cabal sandbox delete > /dev/null
cabal exec my-executable && die "Unexpectedly found executable"
cabal sandbox init > /dev/null
cabal install > /dev/null
# The library should not be available outside the sandbox
"$GHC_PKG" list | grep -v "my-0.1"
# Execute ghc-pkg inside the sandbox; it should find my-0.1
cabal exec ghc-pkg list | grep "my-0.1"
import Test.Cabal.Prelude
import Data.Maybe
main = cabalTest $ do
withPackageDb $ do
withSandbox $ do
fails $ cabal "exec" ["my-executable"]
cabal "install" []
-- The library should not be available outside the sandbox
ghcPkg' "list" [] >>= assertOutputDoesNotContain "my-0.1"
-- Execute ghc-pkg inside the sandbox; it should find my-0.1
cabal' "exec" ["ghc-pkg", "list"]
>>= assertOutputContains "my-0.1"
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