Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doctest #139

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
24 changes: 0 additions & 24 deletions sop-core/doctest.sh

This file was deleted.

29 changes: 29 additions & 0 deletions sop-core/doctests/DocTests.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module Main where

import Test.DocTest

main :: IO ()
main =
doctest
[ "--preserve-it"
, "-XCPP"
, "-XScopedTypeVariables"
, "-XTypeFamilies"
, "-XRankNTypes"
, "-XTypeOperators"
, "-XGADTs"
, "-XConstraintKinds"
, "-XMultiParamTypeClasses"
, "-XTypeSynonymInstances"
, "-XFlexibleInstances"
, "-XFlexibleContexts"
, "-XDeriveFunctor"
, "-XDeriveFoldable"
, "-XDeriveTraversable"
, "-XDefaultSignatures"
, "-XKindSignatures"
, "-XDataKinds"
, "-XFunctionalDependencies"
, "--verbose"
, "src"
]
10 changes: 9 additions & 1 deletion sop-core/sop-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ maintainer: andres@well-typed.com
category: Data
build-type: Simple
cabal-version: >=1.10
extra-source-files: CHANGELOG.md doctest.sh
extra-source-files: CHANGELOG.md
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.2, GHC == 8.10.4, GHC == 9.0.1

source-repository head
Expand Down Expand Up @@ -77,3 +77,11 @@ library
EmptyCase
UndecidableSuperClasses
BangPatterns

test-suite doctests
Copy link
Contributor

@phadej phadej Apr 11, 2021

Choose a reason for hiding this comment

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

Note: this works only for sop-core which doesn't have any non-boot dependencies. In other words this approach (without build-type: Custom and cabal-doctest like thing) won't work for generics-sop.

type: exitcode-stdio-1.0
hs-source-dirs: doctests
default-language: Haskell2010
main-is: DocTests.hs
build-depends: base >= 4.9 && < 4.16,
doctest >= 0.18 && < 0.19