我们在我们的 groovy 代码中使用了几个 AST 转换,例如@ToString
和@EqualsAndHashCode
。我们使用这些,因此我们不必维护和测试它们。问题是代码覆盖率指标(现在使用 jacoco,但如果有帮助可以更改)不知道这些是自动生成的方法,它们会导致很多代码看起来未被发现,即使它实际上不是我们正在编写的代码。
有没有办法将这些从覆盖率指标中包含在任何工具中?
I guess you could argue that since we're putting the annotations we should still be testing the code being generated since a unit test shouldn't care how these methods are created, but just that they work.