首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ScalaTest Maven配置显示每个测试的时间度量

ScalaTest Maven配置显示每个测试的时间度量
EN

Stack Overflow用户
提问于 2013-07-21 15:20:51
回答 1查看 706关注 0票数 0

我想打印每个测试的时间度量。有一种方法可以使用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的一部分:

代码语言:javascript
复制
 <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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-07-21 16:05:40

它位于文件报告器文件名前面的单字母配置参数中。在示例中,它是:

代码语言:javascript
复制
<filereports>WDF TestSuite.txt</filereports>

这些配置参数如下所示:

http://doc.scalatest.org/2.1.5/index.html#org.scalatest.tools.Runner$@configuringReporters

您需要的是D,它可以打印出持续时间,因此:

代码语言:javascript
复制
<filereports>D ProductionCommons.txt</filereports>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17770003

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档