Skip to content

Commit

Permalink
Rudimentary test for sdist --list-sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
quasicomputational authored and 23Skidoo committed May 8, 2018
1 parent 7388950 commit 218c7bf
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions cabal-testsuite/PackageTests/SDist/ListSources/Main.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main = return ()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blah
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blah
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blah
11 changes: 11 additions & 0 deletions cabal-testsuite/PackageTests/SDist/ListSources/list-sources.cabal
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
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'
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'
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"

0 comments on commit 218c7bf

Please sign in to comment.