-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
181 additions
and
15 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
109 changes: 109 additions & 0 deletions
109
...Test/kotlin/kotlinx/kover/gradle/plugin/test/functional/cases/ReportProjectFilterTests.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,109 @@ | ||
/* | ||
* Copyright 2017-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package kotlinx.kover.gradle.plugin.test.functional.cases | ||
|
||
import kotlinx.kover.gradle.plugin.test.functional.framework.configurator.BuildConfigurator | ||
import kotlinx.kover.gradle.plugin.test.functional.framework.starter.SlicedGeneratedTest | ||
|
||
internal class ReportProjectFilterTests { | ||
private val subprojectPath = ":common" | ||
|
||
@SlicedGeneratedTest(allLanguages = true) | ||
fun BuildConfigurator.testInclude() { | ||
addProjectWithKover(subprojectPath) { | ||
sourcesFrom("multiproject-common") | ||
} | ||
|
||
addProjectWithKover { | ||
sourcesFrom("multiproject-user") | ||
dependencyKover(subprojectPath) | ||
|
||
kover { | ||
reports { | ||
filters { | ||
includes { | ||
// show classes only from ':common' project | ||
projects.add(":c?m*") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
run(":koverXmlReport") { | ||
xmlReport { | ||
classCounter("org.jetbrains.CommonClass").assertCovered() | ||
classCounter("org.jetbrains.CommonInternalClass").assertCovered() | ||
classCounter("org.jetbrains.UserClass").assertAbsent() | ||
} | ||
} | ||
} | ||
|
||
@SlicedGeneratedTest(allLanguages = true) | ||
fun BuildConfigurator.testExclude() { | ||
addProjectWithKover(subprojectPath) { | ||
sourcesFrom("multiproject-common") | ||
} | ||
|
||
addProjectWithKover { | ||
sourcesFrom("multiproject-user") | ||
dependencyKover(subprojectPath) | ||
|
||
kover { | ||
reports { | ||
filters { | ||
excludes { | ||
// exclude classes from ':common' project | ||
projects.add(":c?m*") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
run(":koverXmlReport") { | ||
xmlReport { | ||
classCounter("org.jetbrains.CommonClass").assertAbsent() | ||
classCounter("org.jetbrains.CommonInternalClass").assertAbsent() | ||
classCounter("org.jetbrains.UserClass").assertCovered() | ||
} | ||
} | ||
} | ||
|
||
@SlicedGeneratedTest(allLanguages = true) | ||
fun BuildConfigurator.testIncludeAndExclude() { | ||
addProjectWithKover(subprojectPath) { | ||
sourcesFrom("multiproject-common") | ||
} | ||
|
||
addProjectWithKover { | ||
sourcesFrom("multiproject-user") | ||
dependencyKover(subprojectPath) | ||
|
||
kover { | ||
reports { | ||
filters { | ||
includes { | ||
// include all projects | ||
projects.add(":*") | ||
} | ||
excludes { | ||
// exclude classes from ':' project | ||
projects.add(":") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
run(":koverXmlReport") { | ||
xmlReport { | ||
classCounter("org.jetbrains.CommonClass").assertCovered() | ||
classCounter("org.jetbrains.CommonInternalClass").assertCovered() | ||
classCounter("org.jetbrains.UserClass").assertAbsent() | ||
} | ||
} | ||
} | ||
} |
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
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