net.twisterrob.gradle.quality.gather.TestReportGatherer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of twister-quality Show documentation
Show all versions of twister-quality Show documentation
All quality plugins bundled in one.
The newest version!
package net.twisterrob.gradle.quality.gather
import net.twisterrob.gradle.common.listFilesInDirectory
import org.gradle.api.tasks.testing.Test
import se.bjurr.violations.lib.model.Violation
import se.bjurr.violations.lib.reports.Parser
import java.io.File
class TestReportGatherer(
taskType: Class
) : TaskReportGatherer(taskType) where T : Test {
override fun getParsableReportLocation(task: T): File =
@Suppress("detekt.MaxChainedCallsOnSameLine") // Simple enough.
task.reports.junitXml.outputLocation.get().asFile
override fun getHumanReportLocation(task: T): File =
@Suppress("detekt.MaxChainedCallsOnSameLine") // Simple enough.
task.reports.html.outputLocation.get().asFile
override fun getName(task: T): String =
task.path
override fun getDisplayName(task: T): String =
"test"
override fun findViolations(report: File): List {
val reports = report.listFilesInDirectory(File::isFile).toList()
return Parser.JUNIT.findViolations(NoOpLogger, reports).toList()
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy