1 import Data
.List
(isPrefixOf, sort)
2 import Distribution
.Simple
.Glob
3 import Distribution
.Simple
.Glob
.Internal
4 import Distribution
.Simple
.Utils
5 import Distribution
.Verbosity
6 import System
.Directory
7 import Test
.Cabal
.Prelude
9 -- Test that "cabal haddock" preserves temporary files
10 -- We use haddock-keep-temp-file: True in the cabal.project.
12 cabalTest
$ recordMode DoNotRecord
$ withProjectFile
"cabal.project" $ do
15 -- From the docs for `System.IO.openTempFile`:
17 -- On Windows, the template prefix may be truncated to 3 chars, e.g.
18 -- "foobar.ext" will be "fooXXX.ext".
22 else "haddock-response*.txt"
24 -- Check that there is a response file.
25 responseFiles
<- assertGlobMatchesTestDir testTmpDir glob
27 -- Check that the matched response file is not empty, and is indeed a Haddock
29 assertAnyFileContains responseFiles
"--package-name"