Created
October 3, 2014 17:48
-
-
Save kheremos/4d4cec493427476db09d to your computer and use it in GitHub Desktop.
Gradle task to parse a Jacoco report and list the classes where INSTRUCTION_COVERED = 0.
This file contains hidden or 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
task printNakedClasses (dependsOn: test)<< { | |
ext.TEST_FILE_NAME = "$buildDir/reports/jacoco/test/jacocoTestReport.csv" | |
//load and split the file | |
ext.inputFile = file(ext.TEST_FILE_NAME) | |
String[] lines = inputFile.text.split('\n') | |
List<String[]> rows = lines.collect {it.split(',')} | |
def classesUncovered = rows.findAll { row -> | |
row[4]=="0" | |
} | |
println "uncovered classes:" | |
classesUncovered.each { elem -> | |
println "\t${elem[1]}\t${elem[2]}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment