Skip to content

Commit

Permalink
Switch to cabal-doctest
Browse files Browse the repository at this point in the history
Closes #29
  • Loading branch information
expipiplus1 committed May 9, 2020
1 parent 4aad8c0 commit 18f0cca
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 50 deletions.
8 changes: 6 additions & 2 deletions Setup.hs
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
import Distribution.Simple
main = defaultMain
module Main where

import Distribution.Extra.Doctest (defaultMainWithDoctests)

main :: IO ()
main = defaultMainWithDoctests "doctests"
27 changes: 15 additions & 12 deletions exact-real.cabal
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cabal-version: 1.12
cabal-version: 1.24

-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 6f3e15d9117341483cf66f37de3053937a4e86fc60db22da88c152c7c3b4a5c5
-- hash: 94cf687afccded481cfdea2fa373bddbcfc589c1e6acf61feeb0998b943a9ce9

name: exact-real
version: 0.12.2
Expand All @@ -19,7 +19,7 @@ copyright: 2015 Joe Hermaszewski
license: MIT
license-file: LICENSE
tested-with: GHC>=8.2.2 && <=8.6.5
build-type: Simple
build-type: Custom
extra-source-files:
.gitignore
readme.md
Expand All @@ -31,6 +31,12 @@ source-repository head
type: git
location: https://github.com/expipiplus1/exact-real

custom-setup
setup-depends:
Cabal
, base
, cabal-doctest >=1 && <1.1

library
exposed-modules:
Data.CReal
Expand All @@ -48,19 +54,16 @@ library
, random >=1.0
default-language: Haskell2010

test-suite doctest
test-suite doctests
type: exitcode-stdio-1.0
main-is: DocTest.hs
main-is: Doctests.hs
other-modules:

hs-source-dirs:
test
ghc-options: -Wall -threaded
build-depends:
base >=4
, directory >=1.0
, doctest >=0.8
, filepath >=1.3
if impl(ghc < 8.0.0)
buildable: False
base
, doctest
default-language: Haskell2010

test-suite test
Expand Down
27 changes: 13 additions & 14 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,14 @@ tests:
condition: impl(ghc < 8.0.0)
buildable: false

doctest:
main: DocTest.hs
other-modules: []
source-dirs: test
ghc-options:
- -Wall
- -threaded
doctests:
main: Doctests.hs
other-modules: ""
source-dirs:
- test
dependencies:
- base >=4
- directory >=1.0
- doctest >=0.8
- filepath >=1.3
when:
condition: impl(ghc < 8.0.0)
buildable: false
- base
- doctest

benchmarks:
bench:
Expand All @@ -99,3 +92,9 @@ benchmarks:
- base >=4
- criterion >=1.1
- exact-real

custom-setup:
dependencies:
- base
- Cabal
- cabal-doctest >= 1 && <1.1
22 changes: 0 additions & 22 deletions test/DocTest.hs

This file was deleted.

10 changes: 10 additions & 0 deletions test/Doctests.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Main where

import Build_doctests ( flags
, module_sources
, pkgs
)
import Test.DocTest ( doctest )

main :: IO ()
main = doctest $ flags <> pkgs <> module_sources

0 comments on commit 18f0cca

Please sign in to comment.