开发者

How to eliminate stack trace when running Specs through SBT?

开发者 https://www.devze.com 2022-12-15 09:06 出处:网络
I have a Scala project th开发者_如何转开发at I\'m using SBT and Specs on. When I run sbt test, it correctly runs my tests, but a failing test results in a huge stack trace.

I have a Scala project th开发者_如何转开发at I'm using SBT and Specs on. When I run sbt test, it correctly runs my tests, but a failing test results in a huge stack trace.

[info] 
== caravan.DependenciesSpec ==
[info]   specifies 
[info]   x Status should mirror single job
org.specs.specification.FailureExceptionWithResult: 'caravan.Status(2)' is not equal to 'caravan.Status(3)'
    at caravan.DependenciesSpec$$anonfun$1.apply(DependenciesSpec.scala:13)
...about 70 lines of stack trace though specs...
[error]   org.specs.specification.FailureExceptionWithResult: 'caravan.Status(2)' is not equal to 'caravan.Status(3)'

What I would expect is that it just reports the test failed. I'm running specs 1.6.0 and SBT 0.5.5 with Scala 2.7.5. My specs are written as:

object DependenciesSpec extends Specification {
...

Is there any way to get usable output out of Specs/SBT?


I just saw that the new xsbt launcher 0.6.10 added a trace on|off|<n> command to control stack trace outputs. See this thread on the sbt google group for release announcement and the issue report.

Apparently it will depend on whether Specs sends the stack trace to sbt too.

0

精彩评论

暂无评论...
验证码 换一张
取 消