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

Port exec/adds_sandbox_bin_directory_to_path to new test suite



Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent a1a015c3
. ./common.sh
cabal sandbox delete > /dev/null
cabal exec my-executable && die "Unexpectedly found executable"
cabal sandbox init > /dev/null
cabal install > /dev/null
# Execute indirectly via bash to ensure that we go through $PATH
cabal exec sh -- -c my-executable || die "Did not find executable"
module Foo where
foo :: String
foo = "foo"
module Main where
main :: IO ()
main = do
putStrLn "This is my-executable"
name: my
version: 0.1
license: BSD3
cabal-version: >= 1.2
build-type: Simple
library
exposed-modules: Foo
build-depends: base
executable my-executable
main-is: My.hs
build-depends: base
import Test.Cabal.Prelude
main = cabalTest $ do
withSandbox $ do
fails $ cabal "exec" ["my-executable"]
cabal "install" []
-- Execute indirectly via bash to ensure that we go through $PATH
cabal' "exec" ["sh", "--", "-c", "my-executable"]
>>= assertOutputContains "This is my-executable"
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