Skip to content

Commit

Permalink
Put dedup test into its own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 9, 2024
1 parent 65f3bf3 commit b9dac5a
Show file tree
Hide file tree
Showing 17 changed files with 47 additions and 371 deletions.
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
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 ()
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
packages: .

import: woops/woops-1.config
import: woops/woops-3.config
import: woops/woops-5.config
Expand Down
328 changes: 0 additions & 328 deletions cabal-testsuite/PackageTests/ConditionalAndImport/cabal.out
Original file line number Diff line number Diff line change
Expand Up @@ -379,336 +379,8 @@ Configuration is affected by the following files:
imported by: yops/yops-1.config
imported by: yops-0.project
Up to date
# checking if we detect when the same config is imported via many different paths (we don't)
# cabal v2-build
Configuration is affected by the following files:
- woops-0-packages-in-root.project
- with-ghc.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-0.config
imported by: woops-0-packages-in-root.project
- woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-6.config
imported by: woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-8.config
imported by: woops/woops-7.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-7.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-9.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-9.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-9.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-9.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- woops/woops-9.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-7.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-9.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-9.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-9.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-9.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
- https://www.stackage.org/lts-21.25/cabal.config
imported by: woops/woops-9.config
imported by: woops-8.config
imported by: woops/woops-7.config
imported by: woops-6.config
imported by: woops/woops-5.config
imported by: woops-4.config
imported by: woops/woops-3.config
imported by: woops-2.config
imported by: woops/woops-1.config
imported by: woops-0.config
imported by: woops-0-packages-in-root.project
Resolving dependencies...
Up to date
# checking "using config from message" without URI imports
# cabal v2-build
# checking "using config from message" with URI imports
# cabal v2-build
# checking bad conditional
# cabal v2-build
Error: [Cabal-7090]
Expand Down
Loading

0 comments on commit b9dac5a

Please sign in to comment.