2009-12-31 75 views
2

我有一个Scala项目,我正在使用SBT和规格。当我运行sbt测试时,它正确运行我的测试,但是失败的测试会导致巨大的堆栈跟踪。如何通过SBT运行规格时消除堆栈跟踪?

[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)' 

我期望的是它只是报告测试失败。我使用Scala 2.7.5运行规格1.6.0和SBT 0.5.5。我的规格写为:

object DependenciesSpec extends Specification { 
... 

有没有什么办法让可用输出了规格/ SBT的?

回答

1

我刚刚看到新的xsbt启动程序0.6.10添加了trace on|off|<n>命令来控制堆栈跟踪输出。请参阅sbt google组的thread以了解发布公告和issue report

显然它将取决于Specs是否也将堆栈跟踪发送到sbt

+1

需要规格1.6.2,其中包含用于从sbt启动规格测试的修复程序。请参阅http://code.google.com/p/specs/wiki/ChangeLog。 – huynhjl 2010-01-25 15:03:57