Commit 6c1b5d98 authored by John Ericson's avatar John Ericson
Browse files

Test that unknown build-tools are indeed drawn from the path

parent a7d72ae8
{-# OPTIONS_GHC -F -pgmF my-foreign-preprocessor #-}
module A where
a :: String
a = "0000"
name: build-tools-path-foreign
synopsis: Checks unknown build-tools are drawn from PATH
license: BSD3
category: Testing
build-type: Simple
cabal-version: >=1.10
exposed-modules: A
build-depends: base
build-tools: my-foreign-preprocessor
-- ^ Note the unknown dependency.
default-language: Haskell2010
executable hello-world
main-is: Hello.hs
build-depends: base, build-tools-path-foreign
default-language: Haskell2010
hs-source-dirs: hello
module Main where
import A
main :: IO ()
main = putStrLn a
import Test.Cabal.Prelude
import Control.Monad.IO.Class
import System.Environment
-- Test PATH-munging
-- TODO: Enable this test on Windows
main = setupAndCabalTest $ do
skipIf =<< isWindows
path <- liftIO $ getEnv "PATH"
cwd <- testCurrentDir <$> getTestEnv
r <- withEnv [("PATH", Just $ cwd ++ ":" ++ path)] $ setup_build []
runExe' "hello-world" []
>>= assertOutputContains "1111"
Markdown is supported
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