View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
jacocoTestCoverageVerification { | |
violationRules { | |
rule { | |
element = 'CLASS' | |
limit { | |
counter = 'LINE' |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
jacocoTestCoverageVerification { | |
violationRules { | |
rule { | |
// 'element'가 없으면 프로젝트의 전체 파일을 합친 값을 기준으로 한다. | |
limit { | |
// 'counter'를 지정하지 않으면 default는 'INSTRUCTION' | |
// 'value'를 지정하지 않으면 default는 'COVEREDRATIO' | |
minimum = 0.30 |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
test { | |
// ... (생략) ... | |
finalizedBy 'jacocoTestReport' | |
} | |
jacocoTestReport { | |
// ... (생략) ... |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
task testCoverage(type: Test) { | |
group 'verification' | |
description 'Runs the unit tests with coverage' | |
dependsOn(':test', | |
':jacocoTestReport', | |
':jacocoTestCoverageVerification') |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
test { | |
useJUnitPlatform() | |
} |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
test { | |
jacoco { | |
enabled = true | |
destinationFile = file("$buildDir/jacoco/${name}.exec") | |
includes = [] | |
excludes = [] | |
excludeClassLoaders = [] | |
includeNoLocationClasses = false |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
test { | |
jacoco { | |
destinationFile = file("$buildDir/jacoco/jacoco.exec") | |
} | |
} |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
jacocoTestReport { | |
reports { | |
// 원하는 리포트를 켜고 끌 수 있습니다. | |
html.enabled true | |
xml.enabled false | |
csv.enabled false | |
// 각 리포트 타입 마다 리포트 저장 경로를 설정할 수 있습니다. |
View build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy DSL | |
plugins { | |
id 'jacoco' | |
} | |
jacoco { | |
// JaCoCo 버전 | |
toolVersion = '0.8.5' | |