forked from haskell/cabal
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request haskell#4610 from fgaz/new-run/datafiles
Add datadir env var before running the exe
- Loading branch information
Showing
7 changed files
with
45 additions
and
4 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
11 changes: 11 additions & 0 deletions
11
cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/Datafiles.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,11 @@ | ||
name: Datafiles | ||
version: 1.0 | ||
build-type: Simple | ||
cabal-version: >= 1.10 | ||
data-dir: data | ||
data-files: hello.txt | ||
|
||
executable foo | ||
main-is: Main.hs | ||
build-depends: base | ||
default-language: Haskell2010 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/Main.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,4 @@ | ||
import Paths_Datafiles | ||
|
||
main = putStrLn =<< readFile =<< getDataFileName "hello.txt" | ||
|
8 changes: 8 additions & 0 deletions
8
cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/cabal.out
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,8 @@ | ||
# cabal new-run | ||
Resolving dependencies... | ||
Build profile: with-compiler: ghc-<GHCVER>, optimisation: NormalOptimisation | ||
In order, the following will be built: | ||
- Datafiles-1.0 (exe:foo) (first run) | ||
Configuring executable 'foo' for Datafiles-1.0.. | ||
Preprocessing executable 'foo' for Datafiles-1.0.. | ||
Building executable 'foo' for Datafiles-1.0.. |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/cabal.project
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: . |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/cabal.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,4 @@ | ||
import Test.Cabal.Prelude | ||
main = cabalTest $ | ||
cabal' "new-run" ["foo"] >>= assertOutputContains "Hello World" | ||
|
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/data/hello.txt
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 @@ | ||
Hello World |