Skip to content
Snippets Groups Projects
Unverified Commit 1e62b823 authored by Phil de Joux's avatar Phil de Joux
Browse files

Add test cases that reproduce #7241.

- Move project sdist tests to cabal-testsuite
- Add --ignore-project test
- Duplicate tests but without cabal.project
- Add a cabal.project one folder up
- Add a package Z in the root
- Rerun --accept with more immediate parent project
- Add a readme for the tests
- Fix problems with uv package, update expected output
- Add U and V modules
- Explain what is wrong with cabal.dot-uv.test.hs
- Add a note on cabal.no-project.test.hs
- Explain what is wrong with cabal.sub-pq.test.hs
- Explain what is wrong with cabal.sub-rs.test.hs
- Explain what is wrong with cabal.dot-uv.test.hs
- Leave a note explaining cabal.no-project.test.hs
- Leave a note explaining cabal.project.test.hs
- Leave a note explaining cabal.sub-pq.test.hs
- Explain what is wrong with cabal.sub-rs.test.hs
- Patches for project respecting behaviour
- Explain root ignore-project and no-project tests
- Add *.v2.test.hs variants exercising v2-sdist
- Add v2 patches, test out not using <ROOT>
parent 1a8b93c1
No related branches found
No related tags found
No related merge requests found
Showing
with 93 additions and 0 deletions
# cabal sdist
Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/p-0.1.tar.gz
diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.out b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.out
index 3d6859f99..a7ffc109e 100644
--- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.out
+++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.dot-uv.out
@@ -1,2 +1,2 @@
# cabal sdist
-Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/p-0.1.tar.gz
+Wrote tarball sdist to <ROOT>/cabal.dot-uv.dist/work/./dist/sdist/uv-0.1.tar.gz
import Test.Cabal.Prelude
-- cabal.dot-uv.project has "packages: .". That package is uv.cabal but "cabal
-- sdist" writes sdist/p-0.1.tar.gz instead of the expected sdist/uv-0.1.tar.gz.
-- That is wrong, "cabal sdist" should respect the "--project-file" option but
-- instead probes the parent directory and picks up "../cabal.project" that has
-- "packages: Projects-Default-No/p".
--
-- TODO: Fix this behaviour and apply the patch cabal.dot-uv.patch to update the
-- expected output to what we'd expect if "cabal sdist" respected the project.
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
cabal "sdist" ["all"]
\ No newline at end of file
# cabal v2-sdist
Wrote tarball sdist to <ROOT>/dist-newstyle/sdist/uv-0.1.tar.gz
import Test.Cabal.Prelude
-- cabal.dot-uv.project has "packages: .". That package is uv.cabal and "cabal
-- v2-sdist" writes sdist/uv-0.1.tar.gz. This is correct.
main = cabalTest . withProjectFile "cabal.dot-uv.project" $ do
cabal "v2-sdist" ["all"]
\ No newline at end of file
# cabal sdist
Wrote tarball sdist to <ROOT>/cabal.ignore-project.dist/work/./dist/sdist/uv-0.1.tar.gz
import Test.Cabal.Prelude
-- This test correctly writes sdist/uv-0.1.tar.gz for the uv.cabal package.
main = cabalTest $ do
cabal "sdist" ["all", "--ignore-project"]
\ No newline at end of file
# cabal v2-sdist
Wrote tarball sdist to /home/philderbeast/dev/src/cabalism/cabal/cabal-testsuite/PackageTests/SDist/Respect-Project-File/dist-newstyle/sdist/p-0.1.tar.gz
import Test.Cabal.Prelude
-- This test should have written sdist/uv-0.1.tar.gz for the uv.cabal package
-- but instead it probed up the directory tree, found a default cabal.project
-- and wrote sdist/p-0.1.tar.gz. That is incorrect. It didn't ignore the
-- project.
main = cabalTest $ do
cabal "v2-sdist" ["all", "--ignore-project"]
\ No newline at end of file
# cabal sdist
Wrote tarball sdist to <ROOT>/cabal.no-project.dist/work/./dist/sdist/p-0.1.tar.gz
import Test.Cabal.Prelude
-- When no project is given, "cabal sdist" probes up the directory tree, finds a
-- default cabal.project and writes sdist/p-0.1.tar.gz. That is acceptable. An
-- alternative and reasonable expectation (but not the behaviour seen) is that
-- project probing would not occur and "cabal sdist" would work on the local
-- uv.cabal package.
main = cabalTest $ do
cabal "sdist" ["all"]
\ No newline at end of file
# cabal v2-sdist
Wrote tarball sdist to /home/philderbeast/dev/src/cabalism/cabal/cabal-testsuite/PackageTests/SDist/Respect-Project-File/dist-newstyle/sdist/p-0.1.tar.gz
import Test.Cabal.Prelude
-- When no project is given, "cabal v2-sdist" probes up the directory tree,
-- finds a default cabal.project and writes sdist/p-0.1.tar.gz. That is
-- acceptable. An alternative and reasonable expectation (but not the behaviour
-- seen) is that project probing would not occur and "cabal v2-sdist" would work
-- on the local uv.cabal package.
main = cabalTest $ do
cabal "v2-sdist" ["all"]
\ No newline at end of file
# cabal sdist
Wrote tarball sdist to <ROOT>/cabal.sub-pq.dist/work/./dist/sdist/p-0.1.tar.gz
diff --git a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.out b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.out
index c96d15ee6..12dcc1217 100644
--- a/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.out
+++ b/cabal-testsuite/PackageTests/SDist/Respect-Project-File/Projects-Default-No/cabal.sub-pq.out
@@ -1,2 +1,3 @@
# cabal sdist
Wrote tarball sdist to <ROOT>/cabal.sub-pq.dist/work/./dist/sdist/p-0.1.tar.gz
+Wrote tarball sdist to <ROOT>/cabal.sub-pq.dist/work/./dist/sdist/q-0.1.tar.gz
packages: p/ q/
import Test.Cabal.Prelude
-- cabal.sub-pq.project has "packages: p/ q/" but "cabal sdist" only writes
-- sdist/p-0.1.tar.gz instead of the expected sdist/p-0.1.tar.gz and
-- sdist/q-0.1.tar.gz. That is wrong, "cabal sdist" should respect the
-- "--project-file" option but instead probes the parent directory and picks up
-- "../cabal.project" that has "packages: Projects-Default-No/p".
--
-- TODO: Fix this behaviour and apply the patch cabal.sub-pq.patch to update the
-- expected output to what we'd expect if "cabal sdist" respected the project.
main = cabalTest . withProjectFile "cabal.sub-pq.project" $ do
cabal "sdist" ["all"]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment