-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add woops test - Regen expected output without duplication - Add "when using config from" tests - Remove unnecessary normalizeWindowsOutput - Change assertion message - Match on (\n|\r\n) for line endings - Note /tmp/cabal-testsuite-*/ not seen on Windows - Always have the project itself sort first - Use with-ghc.config with woops project - Remove docProjectConfigPaths - docProjectConfigFiles is the better name when not reporting "imported by" - Use --dry-run for config listing tests - Only use woops project once in tests - Don't use same project twice in tests - Put dedup test into its own folder
- Loading branch information
1 parent
63cb8fd
commit 4ab4537
Showing
17 changed files
with
121 additions
and
2 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/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,2 @@ | ||
# checking "using config from message" with URI imports | ||
# cabal v2-build |
38 changes: 38 additions & 0 deletions
38
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/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,38 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main = cabalTest . recordMode RecordMarked $ do | ||
let log = recordHeader . pure | ||
|
||
log "checking \"using config from message\" with URI imports" | ||
woopping <- fails $ cabal' "v2-build" [ "--dry-run", "--project-file=woops-0-packages-in-woops.project" ] | ||
|
||
-- Use assertRegex when the output is tainted by the temp directory, like | ||
-- this: | ||
-- | ||
-- When using configuration from: | ||
-- - /tmp/cabal-testsuite-282695/woops-0.project | ||
-- - /tmp/cabal-testsuite-282695/woops-2.config etc | ||
assertRegex | ||
"Project configuration with URI imports is listed in full" | ||
"When using configuration from:(\n|\r\n) \ | ||
\ .*woops-0-packages-in-woops\\.project(\n|\r\n) \ | ||
\ .*with-ghc\\.config(\n|\r\n) \ | ||
\ .*woops-0\\.config(\n|\r\n) \ | ||
\ .*woops-2\\.config(\n|\r\n) \ | ||
\ .*woops-4\\.config(\n|\r\n) \ | ||
\ .*woops-6\\.config(\n|\r\n) \ | ||
\ .*woops-8\\.config(\n|\r\n) \ | ||
\ .*woops-1\\.config(\n|\r\n) \ | ||
\ .*woops-3\\.config(\n|\r\n) \ | ||
\ .*woops-5\\.config(\n|\r\n) \ | ||
\ .*woops-7\\.config(\n|\r\n) \ | ||
\ .*woops-9\\.config(\n|\r\n) \ | ||
\ .*https://www.stackage.org/lts-21.25/cabal.config(\n|\r\n)" | ||
woopping | ||
|
||
assertOutputContains | ||
"The following errors occurred: \ | ||
\ - The package directory 'woops' does not contain any .cabal file." | ||
woopping | ||
|
||
return () |
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/with-ghc.config
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 @@ | ||
-- WARNING: Override the `with-compiler: ghc-x.y.z` of the stackage import, of | ||
-- https://www.stackage.org/nightly-yyyy-mm-dd/cabal.config. Otherwise tests | ||
-- will fail with: | ||
-- -Error: [Cabal-5490] | ||
-- -Cannot find the program 'ghc'. User-specified path 'ghc-x.y.z' does not | ||
-- refer to an executable and the program is not on the system path. | ||
with-compiler: ghc |
3 changes: 3 additions & 0 deletions
3
.../PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-0-packages-in-woops.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,3 @@ | ||
packages: woops | ||
|
||
import: woops-0.config |
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-0.config
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: woops/woops-1.config | ||
import: woops/woops-3.config | ||
import: woops/woops-5.config | ||
import: woops/woops-7.config | ||
import: woops/woops-9.config | ||
|
||
import: with-ghc.config |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-2.config
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 @@ | ||
import: woops/woops-3.config | ||
import: https://www.stackage.org/lts-21.25/cabal.config |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-4.config
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 @@ | ||
import: woops/woops-5.config | ||
import: https://www.stackage.org/lts-21.25/cabal.config |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-6.config
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 @@ | ||
import: woops/woops-7.config | ||
import: https://www.stackage.org/lts-21.25/cabal.config |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops-8.config
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 @@ | ||
import: woops/woops-9.config | ||
import: https://www.stackage.org/lts-21.25/cabal.config |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-1.config
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 @@ | ||
import: ../woops-2.config | ||
import: https://www.stackage.org/lts-21.25/cabal.config |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-3.config
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 @@ | ||
import: ../woops-4.config | ||
import: https://www.stackage.org/lts-21.25/cabal.config |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-5.config
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 @@ | ||
import: ../woops-6.config | ||
import: https://www.stackage.org/lts-21.25/cabal.config |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-7.config
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 @@ | ||
import: ../woops-8.config | ||
import: https://www.stackage.org/lts-21.25/cabal.config |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/ConditionalAndImport/DedupUsingConfigFrom/woops/woops-9.config
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 @@ | ||
-- No imports here | ||
import: https://www.stackage.org/lts-21.25/cabal.config |
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
7 changes: 7 additions & 0 deletions
7
cabal-testsuite/PackageTests/ConditionalAndImport/with-ghc.config
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 @@ | ||
-- WARNING: Override the `with-compiler: ghc-x.y.z` of the stackage import, of | ||
-- https://www.stackage.org/nightly-yyyy-mm-dd/cabal.config. Otherwise tests | ||
-- will fail with: | ||
-- -Error: [Cabal-5490] | ||
-- -Cannot find the program 'ghc'. User-specified path 'ghc-x.y.z' does not | ||
-- refer to an executable and the program is not on the system path. | ||
with-compiler: ghc |