我想打印每个测试的时间度量。有一种方法可以使用SBT - http://www.scalatest.org/user_guide/using_scalatest_with_sbt来实现
然而,看着这个页面- http://www.scalatest.org/user_guide/using_the_scalatest_maven_plugin,我不知道要向pom.xml添加什么,所以每次测试都会显示它的持续时间。
我想在pom.xml中配置它,这样我的队友就不必用特殊的标志来运行maven了。我不知道这个是否可能,所以一个否定的答案也可以:)
以下是配置ScalaTest的pom.xml的一部分:
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<configuration>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>ProductionCommons.txt</filereports>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>发布于 2013-07-21 16:05:40
它位于文件报告器文件名前面的单字母配置参数中。在示例中,它是:
<filereports>WDF TestSuite.txt</filereports>这些配置参数如下所示:
http://doc.scalatest.org/2.1.5/index.html#org.scalatest.tools.Runner$@configuringReporters
您需要的是D,它可以打印出持续时间,因此:
<filereports>D ProductionCommons.txt</filereports>https://stackoverflow.com/questions/17770003
复制相似问题