如何在HSpec中指定测试套件?我*.hs
将为每个模块有多个测试文件,并且我想只运行stack test
并运行所有测试。我该如何设置?
我试图在我的阴谋文件中列出这样的测试模块,但是它不起作用:
test-suite foo-test
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Spec.hs
, Mod1Spec.hs
build-depends: base
, containers >= 0.5.6.2
, hqfl
, hspec >= 2.2.3
, hspec >= 2.2.3
, mtl >= 2.2.1
, pipes >= 4.1.8
, random >= 1.1
ghc-options: -threaded -rtsopts -with-rtsopts=-N
default-language: Haskell2010
这是有关hspec测试的一些文档:
http://hspec.github.io/hspec-discover.html
如果您的主要规格模块仅包含以下行:
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
hspec-discover
将扫描目录树以进行规格测试。
另外-这是一个小的hspec示例:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句