Skip to content

Commit 5bd088e

Browse files
committed
Add end-to-end cabal-install test for "build-tool-depends"
Modeled after the extern_build_tools test
1 parent 9ea23b0 commit 5bd088e

File tree

7 files changed

+54
-0
lines changed

7 files changed

+54
-0
lines changed

cabal-install/cabal-install.cabal

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ Extra-Source-Files:
8585
tests/IntegrationTests/new-build/T4017/cabal.project
8686
tests/IntegrationTests/new-build/T4017/p/p.cabal
8787
tests/IntegrationTests/new-build/T4017/q/q.cabal
88+
tests/IntegrationTests/new-build/build_tool_depends.sh
89+
tests/IntegrationTests/new-build/build_tool_depends/cabal.project
90+
tests/IntegrationTests/new-build/build_tool_depends/client/Hello.hs
91+
tests/IntegrationTests/new-build/build_tool_depends/client/client.cabal
92+
tests/IntegrationTests/new-build/build_tool_depends/pre-proc/MyCustomPreprocessor.hs
93+
tests/IntegrationTests/new-build/build_tool_depends/pre-proc/pre-proc.cabal
8894
tests/IntegrationTests/new-build/executable/Main.hs
8995
tests/IntegrationTests/new-build/executable/Setup.hs
9096
tests/IntegrationTests/new-build/executable/Test.hs
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
. ./common.sh
2+
cd build_tool_depends
3+
cabal new-build client
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: client, pre-proc
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{-# OPTIONS_GHC -F -pgmF zero-to-one #-}
2+
module Main where
3+
4+
a :: String
5+
a = "0000"
6+
7+
main :: IO ()
8+
main = putStrLn a
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
build-tool-depends: pre-proc:zero-to-one
13+
default-language: Haskell2010
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module Main where
2+
3+
import System.Environment
4+
import System.IO
5+
6+
main :: IO ()
7+
main = do
8+
(_:source:target:_) <- getArgs
9+
let f '0' = '1'
10+
f c = c
11+
writeFile target . map f =<< readFile source
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: pre-proc
2+
version: 999.999.999
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 zero-to-one
10+
main-is: MyCustomPreprocessor.hs
11+
build-depends: base, directory
12+
default-language: Haskell2010

0 commit comments

Comments
 (0)