-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests can now specify files with a `.stdout` or `.stderr` suffix to assert where Cabal writes output to. `.out` will continue to work for testing what output Cabal generates ignoring which file descriptor that output is sent to. This commit also simplifies the `test{,Normalized}{Actual,Expect}File{Out,Stdout,Stderr}` family of functions
- Loading branch information
Showing
18 changed files
with
188 additions
and
61 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 @@ | ||
module M where |
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,2 @@ | ||
main :: IO () | ||
main = fail "Setup called despite `build-type:Simple`" |
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 build | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- my-0 (lib) (first run) | ||
Configuring library for my-0.. | ||
Preprocessing library for my-0.. | ||
Building library for my-0.. |
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: . |
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 @@ | ||
Resolving dependencies... | ||
Build profile: -w ghc-<GHCVER> -O1 | ||
In order, the following will be built: | ||
- my-0 (lib) (first run) | ||
Configuring library for my-0.. | ||
Preprocessing library for my-0.. | ||
Building library for my-0.. |
Empty file.
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 :: IO () | ||
main = cabalTest $ cabal "build" ["all"] |
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,9 @@ | ||
cabal-version: 3.0 | ||
name: my | ||
version: 0 | ||
-- tests that output goes to the correct file descriptors | ||
|
||
library | ||
exposed-modules: M | ||
build-depends: base | ||
default-language: Haskell2010 |
13 changes: 13 additions & 0 deletions
13
cabal-testsuite/PackageTests/TestSuiteTests/LibV09/setup-deadlock.cabal.err
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,13 @@ | ||
# Setup configure | ||
Configuring LibV09-0.1... | ||
# Setup build | ||
Preprocessing library for LibV09-0.1.. | ||
Building library for LibV09-0.1.. | ||
Preprocessing test suite 'LibV09-Deadlock' for LibV09-0.1.. | ||
Building test suite 'LibV09-Deadlock' for LibV09-0.1.. | ||
# Setup test | ||
Running 1 test suites... | ||
Test suite LibV09-Deadlock: RUNNING... | ||
Test suite LibV09-Deadlock: FAIL | ||
Test suite logged to: setup-deadlock.cabal.dist/work/dist/test/LibV09-0.1-LibV09-Deadlock.log | ||
0 of 1 test suites (0 of 1000 test cases) passed. |
14 changes: 14 additions & 0 deletions
14
cabal-testsuite/PackageTests/TestSuiteTests/LibV09/setup-deadlock.err
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,14 @@ | ||
# Setup configure | ||
Configuring LibV09-0.1... | ||
# Setup build | ||
Preprocessing library for LibV09-0.1.. | ||
Building library for LibV09-0.1.. | ||
Preprocessing test suite 'LibV09-Deadlock' for LibV09-0.1.. | ||
Building test suite 'LibV09-Deadlock' for LibV09-0.1.. | ||
# Setup test | ||
Running 1 test suites... | ||
Test suite LibV09-Deadlock: RUNNING... | ||
Test suite LibV09-Deadlock: FAIL | ||
Test suite logged to: | ||
setup-deadlock.dist/work/dist/test/LibV09-0.1-LibV09-Deadlock.log | ||
0 of 1 test suites (0 of 1000 test cases) passed. |
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/TestSuiteTests/LibV09/setup.cabal.err
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 @@ | ||
# Setup configure | ||
Configuring LibV09-0.1... | ||
# Setup build | ||
Preprocessing library for LibV09-0.1.. | ||
Building library for LibV09-0.1.. | ||
Preprocessing test suite 'LibV09-Deadlock' for LibV09-0.1.. | ||
Building test suite 'LibV09-Deadlock' for LibV09-0.1.. |
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 @@ | ||
# Setup configure | ||
Configuring LibV09-0.1... | ||
# Setup build | ||
Preprocessing library for LibV09-0.1.. | ||
Building library for LibV09-0.1.. | ||
Preprocessing test suite 'LibV09-Deadlock' for LibV09-0.1.. | ||
Building test suite 'LibV09-Deadlock' for LibV09-0.1.. |
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
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
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 @@ | ||
synopsis: Test where Cabal writes output to | ||
packages: Cabal | ||
issues: #7790 |