/
InstrumentationFilteringTests.kt
49 lines (43 loc) · 1.56 KB
/
InstrumentationFilteringTests.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 InstrumentationFilteringTests : BaseGradleScriptTest() {
@Test
fun testExclude() {
val build = diverseBuild(ALL_LANGUAGES, ALL_ENGINES, ALL_TYPES)
build.addKoverRootProject {
sourcesFrom("simple")
testTasks {
excludes("org.jetbrains.*Exa?ple*")
}
}
val runner = build.prepare()
runner.run("build", "koverXmlReport") {
xml(defaultXmlReport()) {
classCounter("org.jetbrains.ExampleClass").assertFullyMissed()
classCounter("org.jetbrains.SecondClass").assertCovered()
}
}
}
@Test
fun testExcludeInclude() {
val build = diverseBuild(ALL_LANGUAGES, ALL_ENGINES, ALL_TYPES)
build.addKoverRootProject {
sourcesFrom("simple")
testTasks {
includes("org.jetbrains.*Cla?s")
excludes("org.jetbrains.*Exa?ple*")
}
}
val runner = build.prepare()
runner.run("build", "koverXmlReport") {
xml(defaultXmlReport()) {
classCounter("org.jetbrains.ExampleClass").assertFullyMissed()
classCounter("org.jetbrains.Unused").assertFullyMissed()
classCounter("org.jetbrains.SecondClass").assertCovered()
}
}
}
}