forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test to check that extra-prog-path is honoured for local packages
Whilst fixing haskell#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.
- Loading branch information
1 parent
bb4ae8b
commit ee2b3fb
Showing
7 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
packages: client |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/ExtraProgPathLocal/client/Hello.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Main where | ||
|
||
main = print 0 |
12 changes: 12 additions & 0 deletions
12
cabal-testsuite/PackageTests/ExtraProgPathLocal/client/client.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#! /usr/bin/env bash | ||
|
||
echo "I am not the alex you are looking for" |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/ExtraProgPathLocal/scripts2/alex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#! /usr/bin/env bash | ||
|
||
echo "I am the alex you are looking for" | ||
echo "module Main where main = print ()" > $3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# cabal v2-build | ||
Configuration is affected by the following files: | ||
- cabal.project | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -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... |
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/ExtraProgPathLocal/setup.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |