【问题标题】:Emma coverage reports and integration testsEmma 覆盖率报告和集成测试
【发布时间】:2011-12-06 16:42:17
【问题描述】:

有没有办法让 Emma 报告集成测试?目前我们的 Emma 覆盖范围仅显示单元测试。

添加澄清: 我们正在使用 Maven 来运行构建和测试。测试是使用 testng 而不是 jUnit 运行的,我们正在运行 surefire 插件:maven-surefire-plugin

【问题讨论】:

  • 您的集成测试是什么样的?它们也是 JUnit 测试还是某种 GUI 测试...?

标签: testng integration-testing maven-surefire-plugin emma


【解决方案1】:

我花了很多时间试图让 Emma 在结果覆盖中包含集成测试。我查看了 emma4it 插件,但我能找到的唯一文档是 this blog post from 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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-10
    • 1970-01-01
    • 2012-05-08
    • 2016-11-18
    • 1970-01-01
    • 2012-07-18
    • 2020-02-24
    • 2018-07-25
    相关资源
    最近更新 更多