views:

145

answers:

1

I have a Scala project that 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?

+1  A: 

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.

huynhjl
Will require Specs 1.6.2 which contains a fix for launching Specs test from sbt. See http://code.google.com/p/specs/wiki/ChangeLog.
huynhjl