Skip to content

Commit da8bc40

Browse files
committed
Re #6666 Re-activate test haddock-options
1 parent b5bc0cc commit da8bc40

File tree

1 file changed

+20
-13
lines changed
  • tests/integration/tests/haddock-options

1 file changed

+20
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
import StackTest
1+
import Control.Monad ( unless )
2+
import Data.List ( isInfixOf )
3+
import StackTest
24

35
main :: IO ()
46
main = do
5-
removeDirIgnore ".stack-work"
7+
removeDirIgnore ".stack-work"
68

7-
-- Disabling the test with GHC 9.8.4 because, unlike earlier versions, it fails
8-
-- to fail, despite the Haddock options working as expected.
9-
--
10-
-- -- Fails to work because BAR is defined here and FOO in stack file
11-
-- stackErr ["haddock", "--haddock-arguments", "--optghc=-DBAR"]
12-
stack ["clean"]
13-
-- Works just fine, test #3099 while at it.
14-
stack ["haddock", "--no-haddock-hyperlink-source"]
15-
stack ["clean"]
16-
-- Fails to work because we have bad argument
17-
stackErr ["haddock", "--haddock-arguments", "--stack_it_badhaddockargument"]
9+
-- BAR is defined here and FOO in stack.yaml file
10+
stackCheckStderr ["haddock", "--haddock-arguments", "--optghc=-DBAR"] $ \s ->
11+
unless (errorMsg `isInfixOf` s) $
12+
error "FOO and BAR not both defined"
13+
stack ["clean"]
14+
-- Works just fine, test #3099 while at it.
15+
stack ["haddock", "--no-haddock-hyperlink-source"]
16+
stack ["clean"]
17+
-- Fails to work because we have bad argument
18+
stackErr ["haddock", "--haddock-arguments", "--stack_it_badhaddockargument"]
19+
20+
-- The error message differs by operating system
21+
errorMsg :: String
22+
errorMsg = if isLinux
23+
then "error: #error FOO and BAR is defined"
24+
else "error: FOO and BAR is defined"

0 commit comments

Comments
 (0)