Code coverage in Java with EclEmma not scanning expecting exception methods

后端 未结 3 1426
滥情空心
滥情空心 2021-01-04 00:39

I\'m trying to get my code coverage in java, using Eclipse and EclEmma.

My tests are using JUnit 4 and I\'ve got some tests looking like this :

    @         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-04 01:09

    I faced the same issue, and offered a pull request dealing with the most prominent cause of this annoyance. Instead of adding way too many probes, I only deal with the opcodes of method invocations. In other words, the problem of (previously) wrong coverage results caused by an exception thrown by a method invocation is solved, but not if the exception is thrown by, for example, a division by zero, a wrong cast, or an array index problem.

    https://github.com/jacoco/jacoco/pull/261

    Feel free to comment on the pull request or participate in the discussion I started on the JaCoCo mailing list.

提交回复
热议问题