说我配置了以下测试包:
test-suite foo-test
ghc-options: -Wall -Werror
cpp-options: -DTEST
default-extensions: OverloadedStrings
main-is: Spec.hs
type: exitcode-stdio-1.0
hs-source-dirs: app, test
build-depends: Foo, base >= 4.8 && < 4.9, containers >= 0.5 && <0.6, split >= 0.2 && < 0.3, hspec, QuickCheck
default-language: Haskell2010
以下规范文件:
import Test.Hspec
main :: IO ()
main = hspec $ do
describe "True" $ do
it "True" $ do
True `shouldBe` True
像这样的库定义:
library
build-depends: base, slack-api, text, lens, hashmap, exceptions, mtl, warp
default-extensions: OverloadedStrings
, TemplateHaskell
hs-source-dirs: app
Exposed-modules: Main
default-language: Haskell2010
当我运行stack build
时,库正确构建。
但是,当我运行slack test
时,会失败并显示:
slack-api-0.9: test (suite: tests)
Foo-0.1.0.0: test (suite: foo-test)
Completed 2 action(s).
Test suite failure for package slack-api-0.9
tests: exited with: ExitFailure 1
Full log available at /Users/abe/github/personal/foo/.stack-work/logs/slack-api-0.9-test.log
列出的日志文件为空。还有一个包含
的附加Foo-0.1.1.1.log文件True
True
Finished in 0.0011 seconds
1 example, 0 failures
所以我的“测试”正在运行。但依赖性(和失败)的测试也是如此。可能是什么导致了这个?我该如何防止这种情况?