Skip to content

Commit 4bbc0dd

Browse files
committed
Add a test to check that extra-prog-path is honoured for local packages
Whilst fixing #10692, I realised there was also this bug where extra-prog-path would not be honoured for specific packages. The idea behind extra-prog-path is that each local package can use a different version of a preprocessor if desired.
1 parent 399aae7 commit 4bbc0dd

File tree

7 files changed

+40
-0
lines changed

7 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: client
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Main where
2+
3+
main = print 0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: client
2+
version: 0.1.0.0
3+
synopsis: Checks build-tool-depends are put in PATH
4+
license: BSD3
5+
category: Testing
6+
build-type: Simple
7+
cabal-version: >=1.10
8+
9+
executable hello-world
10+
main-is: Hello.hs
11+
build-depends: base
12+
default-language: Haskell2010
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#! /usr/bin/env bash
2+
3+
echo "I am not the alex you are looking for"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /usr/bin/env bash
2+
3+
echo "I am the alex you are looking for"
4+
echo "module Main where main = print ()" > $3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# cabal v2-build
2+
Configuration is affected by the following files:
3+
- cabal.project
4+
Resolving dependencies...
5+
Build profile: -w ghc-<GHCVER> -O1
6+
In order, the following will be built:
7+
- client-0.1.0.0 (exe:hello-world) (first run)
8+
Configuring executable 'hello-world' for client-0.1.0.0...
9+
Preprocessing executable 'hello-world' for client-0.1.0.0...
10+
Building executable 'hello-world' for client-0.1.0.0...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Test.Cabal.Prelude
2+
-- Test package local extra-prog-path works.
3+
main = cabalTest $ do
4+
skipIfWindows
5+
env <- getTestEnv
6+
liftIO $ appendFile (testCurrentDir env </> "cabal.project") $ "\npackage client\n extra-prog-path:" ++ (testCurrentDir env </> "scripts2/")
7+
addToPath (testTmpDir env </> "scripts/") $ cabal "v2-build" ["client"]

0 commit comments

Comments
 (0)