Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Setup.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Distribution.Simple
module Main where

import Distribution.Extra.Doctest (defaultMainWithDoctests)

main :: IO ()
main = defaultMain
main = defaultMainWithDoctests "doctests"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom set up with cabal-doctest has not been necessary for a few years now

25 changes: 15 additions & 10 deletions random.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ description:
See "System.Random.Stateful" for more details.

category: System
build-type: Simple
build-type: Custom
extra-source-files:
README.md
CHANGELOG.md
Expand Down Expand Up @@ -129,21 +129,21 @@ test-suite legacy-test
random

test-suite doctests
if impl(ghc < 8.2) || impl(ghc >= 8.10)
buildable: False
type: exitcode-stdio-1.0
main-is: doctests.hs
hs-source-dirs: test
default-language: Haskell2010
build-depends:
base,
doctest >=0.15 && <0.20
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
doctest >=0.15 && <0.20,
mwc-random >=0.13 && <0.16,
primitive >=0.6 && <0.8,
random,
stm,
unliftio >=0.2 && <0.3,
vector >= 0.10 && <0.14

test-suite spec
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -219,3 +219,8 @@ benchmark bench
random,
splitmix >=0.1 && <0.2,
tasty-bench

custom-setup
setup-depends:
base >= 4 && <5,
cabal-doctest >= 1 && <1.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need cabal-doctest? It has been deprecated (see hackage)

15 changes: 2 additions & 13 deletions test/doctests.hs
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
{-# LANGUAGE CPP #-}
module Main where

#if __GLASGOW_HASKELL__ >= 802 && __GLASGOW_HASKELL__ < 810

import Build_doctests (flags, pkgs, module_sources)
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 = doctest $ flags ++ pkgs ++ module_sources