diff --git a/cabal-testsuite/PackageTests/ExtraProgPathLocal/cabal.project b/cabal-testsuite/PackageTests/ExtraProgPathLocal/cabal.project new file mode 100644 index 00000000000..7c64e37f6d3 --- /dev/null +++ b/cabal-testsuite/PackageTests/ExtraProgPathLocal/cabal.project @@ -0,0 +1 @@ +packages: client diff --git a/cabal-testsuite/PackageTests/ExtraProgPathLocal/client/Hello.x b/cabal-testsuite/PackageTests/ExtraProgPathLocal/client/Hello.x new file mode 100644 index 00000000000..28f179506bf --- /dev/null +++ b/cabal-testsuite/PackageTests/ExtraProgPathLocal/client/Hello.x @@ -0,0 +1,3 @@ +module Main where + +main = print 0 diff --git a/cabal-testsuite/PackageTests/ExtraProgPathLocal/client/client.cabal b/cabal-testsuite/PackageTests/ExtraProgPathLocal/client/client.cabal new file mode 100644 index 00000000000..825fb893922 --- /dev/null +++ b/cabal-testsuite/PackageTests/ExtraProgPathLocal/client/client.cabal @@ -0,0 +1,12 @@ +name: client +version: 0.1.0.0 +synopsis: Checks build-tool-depends are put in PATH +license: BSD3 +category: Testing +build-type: Simple +cabal-version: >=1.10 + +executable hello-world + main-is: Hello.hs + build-depends: base + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/ExtraProgPathLocal/scripts/alex b/cabal-testsuite/PackageTests/ExtraProgPathLocal/scripts/alex new file mode 100755 index 00000000000..5fd07c9795b --- /dev/null +++ b/cabal-testsuite/PackageTests/ExtraProgPathLocal/scripts/alex @@ -0,0 +1,3 @@ +#! /usr/bin/env bash + +echo "I am not the alex you are looking for" diff --git a/cabal-testsuite/PackageTests/ExtraProgPathLocal/scripts2/alex b/cabal-testsuite/PackageTests/ExtraProgPathLocal/scripts2/alex new file mode 100755 index 00000000000..671539c560e --- /dev/null +++ b/cabal-testsuite/PackageTests/ExtraProgPathLocal/scripts2/alex @@ -0,0 +1,4 @@ +#! /usr/bin/env bash + +echo "I am the alex you are looking for" +echo "module Main where main = print ()" > $3 diff --git a/cabal-testsuite/PackageTests/ExtraProgPathLocal/setup.out b/cabal-testsuite/PackageTests/ExtraProgPathLocal/setup.out new file mode 100644 index 00000000000..8bcc416af16 --- /dev/null +++ b/cabal-testsuite/PackageTests/ExtraProgPathLocal/setup.out @@ -0,0 +1,10 @@ +# cabal v2-build +Configuration is affected by the following files: +- cabal.project +Resolving dependencies... +Build profile: -w ghc- -O1 +In order, the following will be built: + - client-0.1.0.0 (exe:hello-world) (first run) +Configuring executable 'hello-world' for client-0.1.0.0... +Preprocessing executable 'hello-world' for client-0.1.0.0... +Building executable 'hello-world' for client-0.1.0.0... diff --git a/cabal-testsuite/PackageTests/ExtraProgPathLocal/setup.test.hs b/cabal-testsuite/PackageTests/ExtraProgPathLocal/setup.test.hs new file mode 100644 index 00000000000..c7d6e15b913 --- /dev/null +++ b/cabal-testsuite/PackageTests/ExtraProgPathLocal/setup.test.hs @@ -0,0 +1,7 @@ +import Test.Cabal.Prelude +-- Test package local extra-prog-path works. +main = cabalTest $ do + skipIfWindows + env <- getTestEnv + liftIO $ appendFile (testCurrentDir env "cabal.project") $ "\npackage client\n extra-prog-path:" ++ (testCurrentDir env "scripts2/") + addToPath (testTmpDir env "scripts/") $ cabal "v2-build" ["client"]