有没有办法让 Emma 报告集成测试?目前,我们的 Emma 覆盖范围仅显示单元测试。
添加澄清:我们正在使用 maven 运行构建和测试。测试是使用 testng 而不是 jUnit 运行的,我们正在运行 surefire 插件:maven-surefire-plugin
有没有办法让 Emma 报告集成测试?目前,我们的 Emma 覆盖范围仅显示单元测试。
添加澄清:我们正在使用 maven 运行构建和测试。测试是使用 testng 而不是 jUnit 运行的,我们正在运行 surefire 插件:maven-surefire-plugin
我花了很多时间试图让 Emma 在结果覆盖中包含集成测试。我查看了 emma4it 插件,但我能找到的唯一文档是来自 Sonatype 的这篇博客文章,但无法让它工作。
最后我放弃了,转而使用JaCoCo。它是由写艾玛的同一个人写的,因此打算成为它的继任者。我没有尝试将它与 testng 一起使用,但我通过将以下“插件”声明添加到 POM 中使其与 jUnit 一起使用:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>install</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>