Skip to content

Commit

Permalink
Disable doctests
Browse files Browse the repository at this point in the history
Starting with `random-1.3.0` doctests are executed in a CI by invoking
`doctest` executable directly, which turns out to be the correct way to
use doctest. This was pointed out in #165

In order to avoid `random-1.2.x` major version depending on doctest, this
patch removes doctest usage completely, in favor of a new setup going
forward. However, in order to prevent tooling breakaage downstream that
runs tests we do not remove the `doctest` executable section.
  • Loading branch information
lehins committed Dec 14, 2024
1 parent ba5587f commit 3059890
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
12 changes: 1 addition & 11 deletions random.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,7 @@ test-suite doctests
main-is: doctests.hs
hs-source-dirs: test
default-language: Haskell2010
build-depends:
base,
doctest >=0.15 && <0.23
if impl(ghc >= 8.2) && impl(ghc < 8.10)
build-depends:
mwc-random >=0.13 && <0.16,
primitive >=0.6 && <0.8,
random,
stm,
unliftio >=0.2 && <0.3,
vector >= 0.10 && <0.14
build-depends: base

test-suite spec
type: exitcode-stdio-1.0
Expand Down
16 changes: 1 addition & 15 deletions test/doctests.hs
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
{-# LANGUAGE CPP #-}
module Main where

#if __GLASGOW_HASKELL__ >= 802 && __GLASGOW_HASKELL__ < 810

import Test.DocTest (doctest)

main :: IO ()
main = doctest ["src"]

#else

-- Also disabled in cabal file.
-- TODO: fix doctest support
main :: IO ()
main = putStrLn "\nDoctests are not supported for older ghc version\n"

#endif
main = putStrLn "Doctest have been removed from the cabal into a standalone CI step in random-1.3"

0 comments on commit 3059890

Please sign in to comment.