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.
Cabal: Honour -working-dir flag when running test executables
A simple fix to run the test executable in the `-working-dir`. Fixes haskell#10704
- Loading branch information
1 parent
1c7243f
commit 3bfd51e
Showing
9 changed files
with
68 additions
and
2 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
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 @@ | ||
packages: regression-simple | ||
|
||
tests: True |
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,6 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main = cabalTest . recordMode DoNotRecord $ do | ||
-- Building a target that contains whitespace | ||
cabal "test" ["regression-simple"] | ||
cabal "bench" ["regression-simple"] |
5 changes: 5 additions & 0 deletions
5
cabal-testsuite/PackageTests/TestChangeDir/regression-simple/CHANGELOG.md
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,5 @@ | ||
# Revision history for regression-simple | ||
|
||
## 0.1.0.0 -- YYYY-mm-dd | ||
|
||
* First version. Released on an unsuspecting world. |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/TestChangeDir/regression-simple/bench/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 @@ | ||
module Main (main) where | ||
|
||
main :: IO () | ||
main = readFile "do-i-exist.txt" >>= print |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/TestChangeDir/regression-simple/do-i-exist.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 @@ | ||
I exist |
27 changes: 27 additions & 0 deletions
27
cabal-testsuite/PackageTests/TestChangeDir/regression-simple/regression-simple.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,27 @@ | ||
cabal-version: 3.14 | ||
name: regression-simple | ||
version: 0.1.0.0 | ||
license: NONE | ||
author: Matthew Pickering | ||
maintainer: [email protected] | ||
build-type: Simple | ||
extra-doc-files: CHANGELOG.md | ||
|
||
common warnings | ||
ghc-options: -Wall | ||
|
||
test-suite regression-simple-test | ||
import: warnings | ||
default-language: Haskell2010 | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: test | ||
main-is: Main.hs | ||
build-depends: base ^>=4.20.0.0 | ||
|
||
benchmark regression-simple-bench | ||
import: warnings | ||
default-language: Haskell2010 | ||
type: exitcode-stdio-1.0 | ||
hs-source-dirs: bench | ||
main-is: Main.hs | ||
build-depends: base ^>=4.20.0.0 |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/TestChangeDir/regression-simple/test/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 @@ | ||
module Main (main) where | ||
|
||
main :: IO () | ||
main = readFile "do-i-exist.txt" >>= print |
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 @@ | ||
synopsis: Honour the `-working-dir` flag when executing testsuite executables. | ||
packages: Cabal | ||
prs: #10725 | ||
issues: #10704 | ||
significance: | ||
|
||
description: { | ||
|
||
Honour the `-working-dir` flag when executing testsuite executables. This fixes a | ||
regression in Cabal-3.14.0.0. | ||
|
||
} |