Lombok注释与Cobertura或类似工具中的代码覆盖率 [英] Lombok annotations vs code coverage in Cobertura or similar tool

查看:291
本文介绍了Lombok注释与Cobertura或类似工具中的代码覆盖率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

配置cobertura以忽略某些代码块

根据我从上述问题中所读到的内容,Cobertura中无法将给定的代码部分排除在测试范围之外,而无法覆盖测试范围.

From what I have read from above question, there's no way in Cobertura to exclude given code part from being tested versus having coverage in tests.

是真的吗? /是否可以在任何类似工具中使用?

Is that true? / Is it possible in any simmilar tool?

我使用的是 Lombok 注释@Getter@Setter等,它们很棒,但是即使在我覆盖范围内,它们也会在覆盖率报告中被标记为红色". m测试getter和setter方法.-我想做些什么...有什么办法可以解决此问题?

I'm usuing Lombok annotations @Getter, @Setter and so on, which are great, but they result in being 'red' in coverage report, even if I'm testing getter and setter methods. - I would like to do something with that... Is there any way to fix this?

推荐答案

不可能首先运行 delombok 在被测试的代码上,对其进行编译,然后通过 Cobertura ?

Isn't it possible to first run delombok over the code under test, compile it and then instrument it by Cobertura?

披露:我是龙目岛项目的开发人员之一

Disclosure: I am one of the Project Lombok developers

这篇关于Lombok注释与Cobertura或类似工具中的代码覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆