mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-18 17:57:11 +03:00
;tests: re-add hledger-lib's tests to the cabal file, as unittests
This commit is contained in:
parent
daab432a29
commit
ca4fade4af
4
Makefile
4
Makefile
@ -419,8 +419,8 @@ pkgtest: $(call def-help,pkgtest, run the test suites in each package )
|
|||||||
doctest: $(call def-help,doctest, run the doctests in hledger-lib module/function docs )
|
doctest: $(call def-help,doctest, run the doctests in hledger-lib module/function docs )
|
||||||
@($(STACKTEST) hledger-lib:test:doctests && echo $@ PASSED) || (echo $@ FAILED; false)
|
@($(STACKTEST) hledger-lib:test:doctests && echo $@ PASSED) || (echo $@ FAILED; false)
|
||||||
|
|
||||||
easytest: $(call def-help,easytest, run the easytest unit tests in hledger-lib )
|
unittest: $(call def-help,unittest, run the unit tests in hledger-lib )
|
||||||
@($(STACKTEST) hledger-lib:test:easytests && echo $@ PASSED) || (echo $@ FAILED; false)
|
@($(STACKTEST) hledger-lib:test:unittests && echo $@ PASSED) || (echo $@ FAILED; false)
|
||||||
|
|
||||||
# assumes an up to date hledger executable is built.
|
# assumes an up to date hledger executable is built.
|
||||||
# I think we don't do it automatically to minimise unnecessary rebuilding.
|
# I think we don't do it automatically to minimise unnecessary rebuilding.
|
||||||
|
@ -4,7 +4,7 @@ cabal-version: 1.12
|
|||||||
--
|
--
|
||||||
-- see: https://github.com/sol/hpack
|
-- see: https://github.com/sol/hpack
|
||||||
--
|
--
|
||||||
-- hash: f8ee8c9fd0412cc0a8cd5c6286b7ef4f9a33ae2a30989dfc0b99c3f79bd55622
|
-- hash: d44cc48a2f9dc087afe19992824ce4e95ddf82662880f81963eb6389a5ef4a83
|
||||||
|
|
||||||
name: hledger-lib
|
name: hledger-lib
|
||||||
version: 1.15.99
|
version: 1.15.99
|
||||||
@ -206,3 +206,59 @@ test-suite doctests
|
|||||||
if (impl(ghc < 8.2))
|
if (impl(ghc < 8.2))
|
||||||
buildable: False
|
buildable: False
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
test-suite unittests
|
||||||
|
type: exitcode-stdio-1.0
|
||||||
|
main-is: unittests.hs
|
||||||
|
hs-source-dirs:
|
||||||
|
./.
|
||||||
|
test
|
||||||
|
ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans
|
||||||
|
build-depends:
|
||||||
|
Decimal
|
||||||
|
, Glob >=0.9
|
||||||
|
, ansi-terminal >=0.6.2.3
|
||||||
|
, array
|
||||||
|
, base >=4.9 && <4.14
|
||||||
|
, base-compat-batteries >=0.10.1 && <0.12
|
||||||
|
, blaze-markup >=0.5.1
|
||||||
|
, bytestring
|
||||||
|
, call-stack
|
||||||
|
, cassava
|
||||||
|
, cassava-megaparsec
|
||||||
|
, cmdargs >=0.10
|
||||||
|
, containers
|
||||||
|
, data-default >=0.5
|
||||||
|
, deepseq
|
||||||
|
, directory
|
||||||
|
, extra >=1.6.3
|
||||||
|
, fgl >=5.5.4.0
|
||||||
|
, file-embed >=0.0.10
|
||||||
|
, filepath
|
||||||
|
, hashtables >=1.2.3.1
|
||||||
|
, hledger-lib
|
||||||
|
, megaparsec >=7.0.0 && <8
|
||||||
|
, mtl
|
||||||
|
, mtl-compat
|
||||||
|
, old-time
|
||||||
|
, parsec >=3
|
||||||
|
, parser-combinators >=0.4.0
|
||||||
|
, pretty-show >=1.6.4
|
||||||
|
, regex-tdfa
|
||||||
|
, safe >=0.2
|
||||||
|
, split >=0.1
|
||||||
|
, tabular >=0.2
|
||||||
|
, tasty >=1.2.3
|
||||||
|
, tasty-hunit >=0.10.0.2
|
||||||
|
, template-haskell
|
||||||
|
, text >=1.2
|
||||||
|
, time >=1.5
|
||||||
|
, timeit
|
||||||
|
, transformers >=0.2
|
||||||
|
, uglymemo
|
||||||
|
, utf8-string >=0.3.5
|
||||||
|
buildable: True
|
||||||
|
if (!impl(ghc >= 8.0))
|
||||||
|
build-depends:
|
||||||
|
semigroups ==0.18.*
|
||||||
|
default-language: Haskell2010
|
||||||
|
@ -186,11 +186,10 @@ tests:
|
|||||||
- condition: (impl(ghc < 8.2))
|
- condition: (impl(ghc < 8.2))
|
||||||
buildable: false
|
buildable: false
|
||||||
|
|
||||||
|
unittests:
|
||||||
# easytests:
|
buildable: true
|
||||||
# buildable: true
|
source-dirs: test
|
||||||
# source-dirs: test
|
main: unittests.hs
|
||||||
# main: easytests.hs
|
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:
|
- hledger-lib
|
||||||
# - hledger-lib
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
{-# LANGUAGE PackageImports #-}
|
{-# LANGUAGE PackageImports #-}
|
||||||
{-
|
{-
|
||||||
Run hledger-lib's easytest tests using the easytest runner.
|
Run hledger-lib's unit tests using tasty's test runner.
|
||||||
Note that we use package-qualified import to overcome
|
Note that we use package-qualified import to overcome
|
||||||
Cabal heuristic missing-home-modules.
|
Cabal heuristic missing-home-modules.
|
||||||
-}
|
-}
|
||||||
import "hledger-lib" Hledger
|
import "hledger-lib" Hledger
|
||||||
main = run tests_Hledger
|
import Test.Tasty (defaultMain)
|
||||||
|
|
||||||
|
main = defaultMain tests_Hledger
|
Loading…
Reference in New Issue
Block a user