-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9966 from sheaf/haddock-tmpFiles
Haddock: use buildSettingKeepTempFiles
- Loading branch information
Showing
6 changed files
with
80 additions
and
34 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
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
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,4 @@ | ||
module Simple where | ||
|
||
-- | For hiding needles. | ||
data Haystack = Haystack |
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 @@ | ||
packages: . | ||
|
||
haddock-keep-temp-files: true |
20 changes: 20 additions & 0 deletions
20
cabal-testsuite/PackageTests/HaddockKeepsTmps/cabal.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,20 @@ | ||
{-# LANGUAGE LambdaCase #-} | ||
import Test.Cabal.Prelude | ||
import Distribution.Verbosity | ||
import Distribution.Simple.Glob | ||
import Distribution.Simple.Glob.Internal | ||
|
||
-- Test that "cabal haddock" preserves temporary files | ||
-- We use haddock-keep-temp-file: True in the cabal.project. | ||
main = cabalTest $ recordMode DoNotRecord $ do | ||
skipIfWindows | ||
|
||
cabal "haddock" [] | ||
|
||
cwd <- fmap testCurrentDir getTestEnv | ||
|
||
(globMatches <$> liftIO (runDirFileGlob silent Nothing cwd (GlobDirRecursive [WildCard, Literal "response", WildCard, Literal "txt"]))) >>= \case | ||
[] -> error "Expecting a response file to exist" | ||
(m:_) -> | ||
-- Assert the matched response file is not empty. | ||
assertFileDoesContain (cwd </> m) "Simple.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,13 @@ | ||
cabal-version: 3.0 | ||
name: HaddockKeepsTmps | ||
version: 0.1 | ||
license: BSD-3-Clause | ||
author: Rodrigo Mesquita | ||
stability: stable | ||
category: PackageTests | ||
build-type: Simple | ||
|
||
library | ||
default-language: Haskell2010 | ||
exposed-modules: Simple | ||
build-depends: base |