Haskell Tasty 测试中的进度报告

问题描述 投票:0回答:1

我的

tasty
测试套件中有很多测试。目前
tasty
运行所有测试,然后一次性打印出结果,例如

Tests
  DeBruijnIndices
    substUnderLambdaClosed:       OK
    liftUnderLambdaOpenType:      OK
  Normalisation
    normaliseLambda:              OK
    normaliseAppLambdaClosedBody: OK
    normaliseAppLambdaOpenBody:   OK

但是,有时我会意外地创建无限循环,并且其中一个测试无法终止。在这种情况下,

tasty
永远不会打印任何内容,即使它在多线程环境中运行测试。这使得无法诊断哪个测试出了问题。

有什么办法可以让

tasty
打印出测试的中间进度吗? v1.5 的 CHANGELOG 的第一个条目表明可能有,但我不知道如何挂钩它,而且似乎没有提供任何示例或文档。

haskell testing tasty progress-reports
1个回答
0
投票
你必须使用

cabal test tests --test-show-detail=streaming


显然在未来(可能是 3.12),新的详细级别将成为默认值,即

direct

,它就像流式传输,但它不会创建日志文件,但有彩色输出:

https://cabal.readthedocs.io/en/latest/setup-commands.html#cmdoption-runhaskell-Setup.hs-test-test-show-details

或者,您可以使用

cabal run tests

,它将测试作为普通可执行文件运行。

© www.soinside.com 2019 - 2024. All rights reserved.