我正在使用带有jacoco插件的Gradle,我正在寻找一种方法来检查项目的所有类在单元测试和至少一半的指令中进行测试。
答案 0 :(得分:1)
这是我找到的解决方案
// apply plugin
apply "jacoco"
jacocoTestCoverageVerification {
violationRules {
rule {
// this rule insure 50% of instructions have been tested
limit {
minimum = 0.5
}
}
rule {
// this rule insure all classes have been tested
limit {
counter = 'CLASS'
value = 'MISSEDCOUNT'
maximum = 0
}
}
}
}