如何强制Emma代码覆盖率报告忽略某些方法? [英] How to force Emma code coverage report to ignore some methods?

查看:134
本文介绍了如何强制Emma代码覆盖率报告忽略某些方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些方法,例如自动生成的getter,setter,equals和toString,对于测试来说是微不足道的.但是,如果不将它们添加到测试类中,则代码覆盖率(使用Emma计算)将降低,并且可能使我们的系统构建崩溃.

Some methods, such as auto-generated getters, setters, equals and toString, are trivial for test. However, if they aren't added into the testing classes, the code coverage percentage (calculated using Emma) is reduced and may crash our system build.

如何强制Emma在代码覆盖率中忽略这些方法?

How can I force emma to ignore these methods in the code coverage percentage?

此致

魔咒

推荐答案

来自 EMMA常见问题解答:

一种功能,允许EMMA用户将任意方法标记为排除在外的方法 正在考虑将其用于将来的版本.

A feature to allow EMMA users to mark arbitrary methods as excluded from coverage is being considered for future versions.

因此,不幸的是,目前看来这还不可能.为此,存在一个打开功能请求. EMMA的追踪器.

So unfortunately this doesn't seem to be possible at the moment. There's an open feature request for this in EMMA's tracker.

这篇关于如何强制Emma代码覆盖率报告忽略某些方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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