Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All filters for both engines now use only `*` and `?` wildcards. Resolves #21
- Loading branch information
Showing
23 changed files
with
614 additions
and
382 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
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
53 changes: 53 additions & 0 deletions
53
...unctionalTest/kotlin/kotlinx/kover/test/functional/cases/InstrumentationFilteringTests.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,53 @@ | ||
package kotlinx.kover.test.functional.cases | ||
|
||
import kotlinx.kover.api.* | ||
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 InstrumentationFilteringTests : BaseGradleScriptTest() { | ||
|
||
@Test | ||
fun testExcludeIntellij() { | ||
builder() | ||
.case("Test exclusion of classes from instrumentation for IntelliJ coverage agent") | ||
.languages(GradleScriptLanguage.KOTLIN, GradleScriptLanguage.GROOVY) | ||
.types(ProjectType.KOTLIN_JVM, ProjectType.KOTLIN_MULTIPLATFORM) | ||
.engines(CoverageEngine.INTELLIJ) | ||
.sources("simple") | ||
.configTest( | ||
"""excludes = listOf("org.jetbrains.*Exa?ple*")""", | ||
"""excludes = ['org.jetbrains.*Exa?ple*']""" | ||
) | ||
.build() | ||
.run("build") { | ||
xml(DEFAULT_XML) { | ||
assertNull(classCounter("org.jetbrains.ExampleClass")) | ||
assertNotNull(classCounter("org.jetbrains.UnusedClass")) | ||
} | ||
} | ||
} | ||
|
||
@Test | ||
fun testExcludeJaCoCo() { | ||
builder() | ||
.case("Test exclusion of classes from instrumentation for JaCoCo coverage agent") | ||
.languages(GradleScriptLanguage.KOTLIN, GradleScriptLanguage.GROOVY) | ||
.types(ProjectType.KOTLIN_JVM, ProjectType.KOTLIN_MULTIPLATFORM) | ||
.engines(CoverageEngine.JACOCO) | ||
.sources("simple") | ||
.configTest( | ||
"""excludes = listOf("org.jetbrains.*Exa?ple*")""", | ||
"""excludes = ['org.jetbrains.*Exa?ple*']""" | ||
) | ||
.build() | ||
.run("build") { | ||
xml(DEFAULT_XML) { | ||
assertEquals(0, classCounter("org.jetbrains.ExampleClass")!!.covered) | ||
assertNotNull(classCounter("org.jetbrains.UnusedClass")) | ||
} | ||
} | ||
} | ||
|
||
} |
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.