File tree Expand file tree Collapse file tree 5 files changed +48
-0
lines changed
cabal-testsuite/PackageTests/HaddockKeepTmpsCustom Expand file tree Collapse file tree 5 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ import Distribution.Simple
2+
3+ main = defaultMain
Original file line number Diff line number Diff line change 1+ module Simple where
2+
3+ -- | For hiding needles.
4+ data Haystack = Haystack
Original file line number Diff line number Diff line change 1+ packages : .
2+
3+ haddock-keep-temp-files : true
Original file line number Diff line number Diff line change 1+ import Test.Cabal.Prelude
2+
3+ -- Test that "cabal haddock" preserves temporary files
4+ -- We use haddock-keep-temp-file: True in the cabal.project.
5+ main = cabalTest $ recordMode DoNotRecord $ withProjectFile " cabal.project" $ do
6+ cabal " haddock" []
7+
8+ -- From the docs for `System.IO.openTempFile`:
9+ --
10+ -- On Windows, the template prefix may be truncated to 3 chars, e.g.
11+ -- "foobar.ext" will be "fooXXX.ext".
12+ let glob =
13+ if isWindows
14+ then " **/had*.txt"
15+ else " **/haddock-response*.txt"
16+
17+ -- Check that there is a response file.
18+ responseFiles <- assertGlobMatchesTestDir testDistDir glob
19+
20+ -- Check that the matched response file is not empty, and is indeed a Haddock
21+ -- response file.
22+ assertAnyFileContains responseFiles " --package-name"
Original file line number Diff line number Diff line change 1+ cabal-version : 3.0
2+ name : HaddockKeepsTmpsCustom
3+ version : 0.1
4+ license : BSD-3-Clause
5+ author : Rodrigo Mesquita
6+ stability : stable
7+ category : PackageTests
8+ build-type : Custom
9+
10+ custom-setup
11+ setup-depends : Cabal, base
12+
13+ library
14+ default-language : Haskell2010
15+ exposed-modules : Simple
16+ build-depends : base
You can’t perform that action at this time.
0 commit comments