问题描述
我正在使用EclEmma(在Eclipse内部)扫描我的JUnit代码覆盖率.这可以正常工作-但是,我不希望EclEmma扫描我的 src/view
文件夹,因为它包含我认为不值得测试的Swing代码.
运行EclEmma时,有什么方法可以忽略此文件夹,以便:a)运行速度更快,并且b)不会改变覆盖率吗?
我的项目的结构是:
src/viewsrc/模型src/控制器
我在偏好设置"页面的路径条目"部分中尝试了这些(可能是其他):
"src/view""src/view/*"看法"看法/*"源/视图
这些正在使用首选项"页面中的排除"部分:
**看法**查看* .classsrc/view/*查看*src/view/* View * .class
他们都对我的整个src文件夹进行分析后得到相同的结果.
您可以指定排除字段:
但是,使用它们的选项进行类路径匹配可能会更容易:
有关关于如何忽略src文件夹的信息,请参见问题-如何忽略源./p>
还请注意他们的警告,
I am using EclEmma (inside of Eclipse) to scan my JUnit code coverage. This works correctly - however, I do not want EclEmma to scan my src/view
folder since it contains Swing code that I consider not worthy of testing.
Is there any way to ignore this folder when EclEmma runs so that it: a) runs faster, and b) does not skew the coverage percentage?
EDIT:
My project's structure is:
src/view
src/model
src/controller
I have tried these (possibly others) with the Path Entries section in the Preferences page:
"src/view"
"src/view/*"
"view"
"view/*"
src/view
These are using the Excludes section in the Preferences page:
*
*View*
*View*.class
src/view/*View*
src/view/*View*.class
They all leave me with the same result of it analysing my entire src folder.
You can specify an exclude field:
However, it might be easier to use their options for classpath matching:
See eclemma - how to ignore source about how to ignore src folders.
Also please note their caution,
这篇关于如何忽略使用EclEmma和Eclipse扫描某些类的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!