-
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.
Rudimentary test for sdist --list-sources.
- Loading branch information
1 parent
7388950
commit 218c7bf
Showing
8 changed files
with
30 additions
and
0 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 @@ | ||
main = return () |
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 @@ | ||
blah |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/SDist/ListSources/extra-doc/blah/a.tex
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 @@ | ||
blah |
1 change: 1 addition & 0 deletions
1
cabal-testsuite/PackageTests/SDist/ListSources/extra-src/blah/a.html
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 @@ | ||
blah |
11 changes: 11 additions & 0 deletions
11
cabal-testsuite/PackageTests/SDist/ListSources/list-sources.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,11 @@ | ||
cabal-version: 2.2 | ||
name: list-sources | ||
version: 0 | ||
data-dir: data | ||
data-files: blah/*.dat | ||
extra-source-files: extra-src/blah/*.html | ||
extra-doc-files: extra-doc/blah/*.tex | ||
|
||
executable dummy | ||
default-language: Haskell2010 | ||
main-is: Main.hs |
3 changes: 3 additions & 0 deletions
3
cabal-testsuite/PackageTests/SDist/ListSources/list-sources.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,3 @@ | ||
# cabal sdist | ||
List of package sources written to file '<TMPDIR>/sources' | ||
List of package sources written to file '<TMPDIR>/sources' |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/SDist/ListSources/list-sources.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 @@ | ||
# Setup sdist | ||
List of package sources written to file '<TMPDIR>/sources' |
10 changes: 10 additions & 0 deletions
10
cabal-testsuite/PackageTests/SDist/ListSources/list-sources.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,10 @@ | ||
import System.FilePath (normalise) | ||
import Test.Cabal.Prelude | ||
main = setupTest $ do | ||
tmpdir <- fmap testTmpDir getTestEnv | ||
let fn = tmpdir </> "sources" | ||
setup "sdist" ["--list-sources=" ++ fn] | ||
-- --list-sources outputs with slashes on posix and backslashes on Windows. 'normalise' converts our needle to the necessary format. | ||
assertFileDoesContain fn $ normalise "data/blah/a.dat" | ||
assertFileDoesContain fn $ normalise "extra-src/blah/a.html" | ||
assertFileDoesContain fn $ normalise "extra-doc/blah/a.tex" |