Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #17
- Loading branch information
Showing
11 changed files
with
274 additions
and
77 deletions.
There are no files selected for viewing
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
62 changes: 62 additions & 0 deletions
62
src/functionalTest/kotlin/kotlinx/kover/test/functional/cases/ReportsFilteringTests.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package kotlinx.kover.test.functional.cases | ||
|
||
import kotlinx.kover.test.functional.cases.utils.* | ||
import kotlinx.kover.test.functional.core.* | ||
import kotlinx.kover.test.functional.core.BaseGradleScriptTest | ||
import kotlin.test.* | ||
|
||
internal class ReportsFilteringTests : BaseGradleScriptTest() { | ||
|
||
@Test | ||
fun testExclude() { | ||
builder("Test exclusion of classes from XML report") | ||
.languages(GradleScriptLanguage.KOTLIN, GradleScriptLanguage.GROOVY) | ||
.sources("simple") | ||
.config( | ||
""" | ||
tasks.koverMergedXmlReport { | ||
excludes = listOf("org.jetbrains.*Exa?ple*") | ||
}""".trimIndent(), | ||
""" | ||
tasks.koverMergedXmlReport { | ||
excludes = ['org.jetbrains.*Exa?ple*'] | ||
}""".trimIndent() | ||
) | ||
.build() | ||
.run("build") { | ||
xml(defaultXmlReport()) { | ||
assertCounterAbsent(classCounter("org.jetbrains.ExampleClass")) | ||
assertCounterCovered(classCounter("org.jetbrains.SecondClass")) | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun testExcludeInclude() { | ||
builder("Test inclusion and exclusion of classes in XML report") | ||
.languages(GradleScriptLanguage.KOTLIN, GradleScriptLanguage.GROOVY) | ||
.sources("simple") | ||
.config( | ||
""" | ||
tasks.koverMergedXmlReport { | ||
includes = listOf("org.jetbrains.*Cla?s") | ||
excludes = listOf("org.jetbrains.*Exa?ple*") | ||
}""".trimIndent(), | ||
|
||
""" | ||
tasks.koverMergedXmlReport { | ||
includes = ['org.jetbrains.*Cla?s'] | ||
excludes = ['org.jetbrains.*Exa?ple*'] | ||
}""".trimIndent() | ||
) | ||
.build() | ||
.run("build") { | ||
xml(defaultXmlReport()) { | ||
assertCounterAbsent(classCounter("org.jetbrains.ExampleClass")) | ||
assertCounterAbsent(classCounter("org.jetbrains.Unused")) | ||
assertCounterFullyCovered(classCounter("org.jetbrains.SecondClass")) | ||
} | ||
} | ||
} | ||
|
||
} |
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
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
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
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
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
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
Oops, something went wrong.