有没有办法截断测试结果,仅在单元测试失败时才显示单元测试的结果文本?我正在开发一个具有 850 个单元测试的 Scala 项目,成功的单元测试的绿色文本使得很难只关注失败的情况。
我正在谈论的示例:
[info] - should have colors
[info] - should not be dead
//.... x 100
[info] - animals should not be rainbows *** FAILED ***
[info] -"[rainbow]s" was not equal to "[ponie]s" (HappinessSpec.scala:31)
我想要的是只显示失败的东西:
[info] - animals should not be rainbows *** FAILED ***
[info] -"[rainbow]s" was not equal to "[ponie]s" (HappinessSpec.scala:31)
我意识到有test-quick
sbt 命令,但仍然运行 300 成功
在我的例子中,单元测试只有 30 次失败。
在使用方面,我正在寻找类似的东西:
sbt> ~ test -showOnlyFailures
我也会很高兴看到运行结束时显示所有失败的东西
单元测试。 IIRC,这就是 RSpec 在 Ruby 中的工作方式......
将以下内容添加到 build.sbt 后,scalaTest 将在标准报告后显示失败摘要:
testOptions in Test += Tests.Argument("-oI")
I - show reminder of failed and canceled tests without stack traces
T - show reminder of failed and canceled tests with short stack traces
G - show reminder of failed and canceled tests with full stack traces
还有一个“drop TestSucceeded events”标志,但我未能使用它:http://www.scalatest.org/user_guide/using_the_runner http://www.scalatest.org/user_guide/using_the_runner
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)