Skip to content

Commit

Permalink
New cabal flag doctest to control building the doctest test-suite
Browse files Browse the repository at this point in the history
`doctest-parallel` typically is not available for GHC prereleases.
Now the doctest suite switches itself off automatically if it cannot build.
  • Loading branch information
andreasabel committed Aug 2, 2023
1 parent 74038bb commit 89162c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion regex-tdfa.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ flag force-O2
.
__NOTE__: This flag is mostly provided for legacy use-cases. Nowadays you can conveniently control optimization levels on a per-package granularity via @cabal.project@ files; see <https://cabal.readthedocs.io/en/latest/nix-local-build.html#configuring-builds-with-cabal-project cabal's user-guide> for more details.

flag doctest
default: True
manual: False
description:
Include test-suite doctest.

library
hs-source-dirs: lib

Expand Down Expand Up @@ -176,7 +182,7 @@ test-suite regex-tdfa-unittest
if flag(force-O2)
ghc-options: -O2

test-suite doc-test
test-suite doctest
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: DocTestMain.hs
Expand All @@ -188,3 +194,6 @@ test-suite doc-test
-- doctest-parallel-0.2.2 is the first to filter out autogen-modules

default-language: Haskell2010

if !flag(doctest)
buildable: False

0 comments on commit 89162c5

Please sign in to comment.