test: doctest cleanups, use latest
This commit is contained in:
parent
93e76047d7
commit
3ef9958041
@ -162,7 +162,7 @@ test-suite doctest
|
|||||||
, containers >=0.5.9
|
, containers >=0.5.9
|
||||||
, data-default >=0.5
|
, data-default >=0.5
|
||||||
, directory
|
, directory
|
||||||
, doctest >=0.16.3
|
, doctest >=0.18.1
|
||||||
, extra >=1.6.3
|
, extra >=1.6.3
|
||||||
, file-embed >=0.0.10
|
, file-embed >=0.0.10
|
||||||
, filepath
|
, filepath
|
||||||
@ -185,8 +185,6 @@ test-suite doctest
|
|||||||
, uglymemo
|
, uglymemo
|
||||||
, unordered-containers >=0.2
|
, unordered-containers >=0.2
|
||||||
, utf8-string >=0.3.5
|
, utf8-string >=0.3.5
|
||||||
if (impl(ghc < 8.2))
|
|
||||||
buildable: False
|
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
test-suite unittest
|
test-suite unittest
|
||||||
|
|||||||
@ -161,13 +161,13 @@ tests:
|
|||||||
main: doctests.hs # can't call it doctest.hs ("File name does not match module name")
|
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
|
other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188
|
||||||
dependencies:
|
dependencies:
|
||||||
|
# prefer the latest doctest
|
||||||
|
- doctest >=0.18.1
|
||||||
- Glob >=0.7
|
- 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
|
# ghc 8.4+ on mac needs this workaround. See
|
||||||
# https://github.com/sol/doctest/issues/199,
|
# https://github.com/sol/doctest/issues/199
|
||||||
# https://ghc.haskell.org/trac/ghc/ticket/15105#comment:10):
|
# https://ghc.haskell.org/trac/ghc/ticket/15105#comment:10 :
|
||||||
# ~$ locate HSinteger-gmp-1.0.2.0.o
|
# ~$ 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
|
# /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}
|
# ~$ 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:
|
#when:
|
||||||
# - condition: os(darwin) && impl(ghc >= 8.4)
|
# - condition: os(darwin) && impl(ghc >= 8.4)
|
||||||
# buildable: false
|
# 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
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
Run doctests in Hledger source files under the current directory
|
Run doctests in Hledger source files under the current directory
|
||||||
(./Hledger.hs, ./Hledger/**, ./Text/**) using the doctest runner.
|
(./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.
|
Arguments are case-insensitive file path substrings, to limit the files searched.
|
||||||
--verbose shows files being searched for doctests and progress while running.
|
--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).
|
--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:
|
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")
|
-- This file can't be called doctest.hs ("File name does not match module name")
|
||||||
|
|||||||
@ -12,8 +12,9 @@ packages:
|
|||||||
- hledger-ui
|
- hledger-ui
|
||||||
- hledger-web
|
- hledger-web
|
||||||
|
|
||||||
# extra-deps:
|
extra-deps:
|
||||||
# for hledger-lib:
|
# for hledger-lib:
|
||||||
|
- doctest-0.18.1
|
||||||
# for hledger:
|
# for hledger:
|
||||||
# for hledger-ui:
|
# for hledger-ui:
|
||||||
# for hledger-web:
|
# for hledger-web:
|
||||||
|
|||||||
@ -13,7 +13,6 @@ packages:
|
|||||||
- hledger-web
|
- hledger-web
|
||||||
|
|
||||||
extra-deps:
|
extra-deps:
|
||||||
- doctest-0.16.3
|
|
||||||
# for Shake.hs (regex doesn't support base-compat-0.11):
|
# for Shake.hs (regex doesn't support base-compat-0.11):
|
||||||
- regex-1.0.2.0@rev:1
|
- regex-1.0.2.0@rev:1
|
||||||
# for testing base-compat 0.11 compatibility (mutually exclusive with the above):
|
# for testing base-compat 0.11 compatibility (mutually exclusive with the above):
|
||||||
@ -27,6 +26,7 @@ extra-deps:
|
|||||||
- pretty-simple-4.0.0.0
|
- pretty-simple-4.0.0.0
|
||||||
- prettyprinter-1.7.0
|
- prettyprinter-1.7.0
|
||||||
- prettyprinter-ansi-terminal-1.1.2
|
- prettyprinter-ansi-terminal-1.1.2
|
||||||
|
- doctest-0.18.1
|
||||||
# for hledger:
|
# for hledger:
|
||||||
# for hledger-ui:
|
# for hledger-ui:
|
||||||
# for hledger-web:
|
# for hledger-web:
|
||||||
|
|||||||
@ -16,6 +16,7 @@ extra-deps:
|
|||||||
# for hledger-lib:
|
# for hledger-lib:
|
||||||
- pretty-simple-4.0.0.0
|
- pretty-simple-4.0.0.0
|
||||||
- prettyprinter-1.7.0
|
- prettyprinter-1.7.0
|
||||||
|
- doctest-0.18.1
|
||||||
# for hledger:
|
# for hledger:
|
||||||
# for hledger-ui:
|
# for hledger-ui:
|
||||||
# for hledger-web:
|
# for hledger-web:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user