Skip to content

Commit b209b2f

Browse files
committed
Add haddock --keep-temp-files test
1 parent 26abbdb commit b209b2f

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Distribution.Simple
2+
3+
main = defaultMain
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Simple where
2+
3+
-- | For hiding needles.
4+
data Haystack = Haystack
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
packages: .
2+
3+
haddock-keep-temp-files: true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{-# LANGUAGE LambdaCase #-}
2+
3+
import Test.Cabal.Prelude
4+
5+
-- Test that "cabal haddock" preserves temporary files
6+
-- We use haddock-keep-temp-file: True in the cabal.project.
7+
main = cabalTest $ recordMode DoNotRecord $ withProjectFile "cabal.project" $ do
8+
cabal "haddock" []
9+
10+
-- Check that there is a response file.
11+
responseFiles <- assertGlobMatchesTestDir testDistDir "**/haddock-response*.txt"
12+
13+
-- Check that the matched response file is not empty, and is indeed a Haddock
14+
-- response file.
15+
assertAnyFileDoesContain responseFiles "--package-name"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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

0 commit comments

Comments
 (0)