test: doctest cleanups, use latest

This commit is contained in:
Simon Michael 2021-07-16 17:58:57 -10:00
parent 93e76047d7
commit 3ef9958041
6 changed files with 13 additions and 17 deletions

View File

@ -162,7 +162,7 @@ test-suite doctest
, containers >=0.5.9
, data-default >=0.5
, directory
, doctest >=0.16.3
, doctest >=0.18.1
, extra >=1.6.3
, file-embed >=0.0.10
, filepath
@ -185,8 +185,6 @@ test-suite doctest
, uglymemo
, unordered-containers >=0.2
, utf8-string >=0.3.5
if (impl(ghc < 8.2))
buildable: False
default-language: Haskell2010
test-suite unittest

View File

@ -161,13 +161,13 @@ tests:
main: doctests.hs # can't call it doctest.hs ("File name does not match module name")
other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188
dependencies:
# prefer the latest doctest
- doctest >=0.18.1
- Glob >=0.7
# Need a doctest new enough to support --fast and --verbose and ghc 8.10.
- doctest >=0.16.3
# ghc 8.4+ on mac needs this workaround (see
# https://github.com/sol/doctest/issues/199,
# https://ghc.haskell.org/trac/ghc/ticket/15105#comment:10):
# ghc 8.4+ on mac needs this workaround. See
# https://github.com/sol/doctest/issues/199
# https://ghc.haskell.org/trac/ghc/ticket/15105#comment:10 :
# ~$ locate HSinteger-gmp-1.0.2.0.o
# /Users/simon/.stack/programs/x86_64-osx/ghc-8.4.3/lib/ghc-8.4.2/integer-gmp-1.0.2.0/HSinteger-gmp-1.0.2.0.o
# ~$ mv /Users/simon/.stack/programs/x86_64-osx/ghc-8.4.3/lib/ghc-8.4.2/integer-gmp-1.0.2.0/HSinteger-gmp-1.0.2.0.o{,_DISABLE_GHC_ISSUE_15105}
@ -175,9 +175,3 @@ tests:
#when:
# - condition: os(darwin) && impl(ghc >= 8.4)
# buildable: false
# ghc 8.0 on linux gives Hledger/Read/JournalReader.hs:126: failure in expression `rejp (journalp <* eof) "2015/1/1\n a 0\n"' ... Variable not in scope: rejp :: f0 a0 -> [Char] -> t
# must use one conditional here, https://github.com/sol/hpack/issues/379
when:
- condition: (impl(ghc < 8.2))
buildable: false

View File

@ -2,6 +2,8 @@
Run doctests in Hledger source files under the current directory
(./Hledger.hs, ./Hledger/**, ./Text/**) using the doctest runner.
https://github.com/sol/doctest#readme
Arguments are case-insensitive file path substrings, to limit the files searched.
--verbose shows files being searched for doctests and progress while running.
--slow reloads ghci between each test (https://github.com/sol/doctest#a-note-on-performance).
@ -12,7 +14,7 @@ $ make ghci-doctest, :main [--verbose] [--slow] [CIFILEPATHSUBSTRINGS]
or:
$ stack test hledger-lib:test:doctests [--test-arguments '[--verbose] [--slow] [CIFILEPATHSUBSTRINGS]']
$ stack test hledger-lib:test:doctest --test-arguments="--verbose --slow [CIFILEPATHSUBSTRINGS]"
-}
-- This file can't be called doctest.hs ("File name does not match module name")

View File

@ -12,8 +12,9 @@ packages:
- hledger-ui
- hledger-web
# extra-deps:
extra-deps:
# for hledger-lib:
- doctest-0.18.1
# for hledger:
# for hledger-ui:
# for hledger-web:

View File

@ -13,7 +13,6 @@ packages:
- hledger-web
extra-deps:
- doctest-0.16.3
# for Shake.hs (regex doesn't support base-compat-0.11):
- regex-1.0.2.0@rev:1
# for testing base-compat 0.11 compatibility (mutually exclusive with the above):
@ -27,6 +26,7 @@ extra-deps:
- pretty-simple-4.0.0.0
- prettyprinter-1.7.0
- prettyprinter-ansi-terminal-1.1.2
- doctest-0.18.1
# for hledger:
# for hledger-ui:
# for hledger-web:

View File

@ -16,6 +16,7 @@ extra-deps:
# for hledger-lib:
- pretty-simple-4.0.0.0
- prettyprinter-1.7.0
- doctest-0.18.1
# for hledger:
# for hledger-ui:
# for hledger-web: