加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala – 如何在使用sbt和testng时在测试中抛出的异常获得完整的

发布时间:2020-12-16 09:45:51 所属栏目:安全 来源:网络整理
导读:堆栈跟踪被截断 – 例如他们以[info]结尾… 使用最后一个或更改traceLevel不会有帮助 – 它只需打印sbt包装器的完整堆栈跟踪。 这是用testng测试(也相信使用scalatest和sl4j) 解决方法 使用 documentation here中提供的提示: (引) You can configure the ou
堆栈跟踪被截断 – 例如他们以[info]结尾…

使用最后一个或更改traceLevel不会有帮助 – 它只需打印sbt包装器的完整堆栈跟踪。

这是用testng测试(也相信使用scalatest和sl4j)

解决方法

使用 documentation here中提供的提示:

(引)

You can configure the output shown when running with sbt in four ways: 1) turn off color,2) show short stack traces,3) full stack traces,and 4) show durations for everything. To do so you must pass a -o argument to ScalaTest,and after the -o,place any combination of:

  • D – show durations
  • S – show short stack traces
  • F – show full stack traces
  • W – without color

For example,“-oDF” would show full stack traces and durations (the amount of time spent in each test).

To pass arguments from sbt to ScalaTest you can either add test options globally,like this:

06000

(有关其他报价,请参阅网站)

您可以使用以下sbt命令在测试中启用完整堆栈跟踪:

> set testOptions in YourProjectName += Tests.Argument("-oF")

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读