Skip to content

Commit

Permalink
Merge pull request #6667 from commercialhaskell/re6666
Browse files Browse the repository at this point in the history
Re #6666 Re-activate test haddock-options
  • Loading branch information
mpilgrem authored Dec 12, 2024
2 parents d268f12 + da8bc40 commit b8a7fa1
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions tests/integration/tests/haddock-options/Main.hs
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
import StackTest
import Control.Monad ( unless )
import Data.List ( isInfixOf )
import StackTest

main :: IO ()
main = do
removeDirIgnore ".stack-work"
removeDirIgnore ".stack-work"

-- Disabling the test with GHC 9.8.4 because, unlike earlier versions, it fails
-- to fail, despite the Haddock options working as expected.
--
-- -- Fails to work because BAR is defined here and FOO in stack file
-- stackErr ["haddock", "--haddock-arguments", "--optghc=-DBAR"]
stack ["clean"]
-- Works just fine, test #3099 while at it.
stack ["haddock", "--no-haddock-hyperlink-source"]
stack ["clean"]
-- Fails to work because we have bad argument
stackErr ["haddock", "--haddock-arguments", "--stack_it_badhaddockargument"]
-- BAR is defined here and FOO in stack.yaml file
stackCheckStderr ["haddock", "--haddock-arguments", "--optghc=-DBAR"] $ \s ->
unless (errorMsg `isInfixOf` s) $
error "FOO and BAR not both defined"
stack ["clean"]
-- Works just fine, test #3099 while at it.
stack ["haddock", "--no-haddock-hyperlink-source"]
stack ["clean"]
-- Fails to work because we have bad argument
stackErr ["haddock", "--haddock-arguments", "--stack_it_badhaddockargument"]

-- The error message differs by operating system
errorMsg :: String
errorMsg = if isLinux
then "error: #error FOO and BAR is defined"
else "error: FOO and BAR is defined"

0 comments on commit b8a7fa1

Please sign in to comment.