-
Notifications
You must be signed in to change notification settings - Fork 48
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
20 changed files
with
297 additions
and
228 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
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
22 changes: 22 additions & 0 deletions
22
...lTest/kotlin/kotlinx/kover/gradle/plugin/test/functional/cases/CompilationFiltersTests.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,22 @@ | ||
package kotlinx.kover.gradle.plugin.test.functional.cases | ||
|
||
import kotlinx.kover.gradle.plugin.test.functional.framework.checker.CheckerContext | ||
import kotlinx.kover.gradle.plugin.test.functional.framework.checker.defaultXmlReport | ||
import kotlinx.kover.gradle.plugin.test.functional.framework.starter.TemplateTest | ||
|
||
internal class CompilationFiltersTests { | ||
@TemplateTest("sourcesets", ["koverXmlReport"]) | ||
fun CheckerContext.testJvmSourceSetFilter() { | ||
xml(defaultXmlReport()) { | ||
classCounter("kotlinx.kover.examples.sourcesets.ExtraClass").assertAbsent() | ||
} | ||
} | ||
|
||
@TemplateTest("sourcesets-mpp", ["koverXmlReport"]) | ||
fun CheckerContext.testMppSourceSetFilter() { | ||
xml(defaultXmlReport()) { | ||
classCounter("kotlinx.kover.examples.sourcesets.ExtraClass").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
30 changes: 30 additions & 0 deletions
30
src/functionalTest/templates/builds/sourcesets-mpp/build.gradle.kts
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,30 @@ | ||
plugins { | ||
kotlin("multiplatform") version "1.7.10" | ||
id("org.jetbrains.kotlinx.kover") version "0.7.0" | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kover { | ||
excludeSourceSets { | ||
names("extra") | ||
} | ||
} | ||
|
||
sourceSets.create("extra") | ||
|
||
kotlin { | ||
jvm { | ||
withJava() | ||
} | ||
|
||
sourceSets { | ||
val commonTest by getting { | ||
dependencies { | ||
implementation(kotlin("test")) | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/functionalTest/templates/builds/sourcesets-mpp/settings.gradle.kts
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,8 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
} | ||
rootProject.name = "example-source-sets-mpp" | ||
|
7 changes: 7 additions & 0 deletions
7
src/functionalTest/templates/builds/sourcesets-mpp/src/jvmExtra/kotlin/ExtraClass.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,7 @@ | ||
package kotlinx.kover.examples.sourcesets | ||
|
||
class ExtraClass { | ||
fun function() { | ||
println("Example") | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/functionalTest/templates/builds/sourcesets-mpp/src/jvmMain/kotlin/AppClasses.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,17 @@ | ||
package kotlinx.kover.examples.sourcesets | ||
|
||
class ExampleClass { | ||
fun formatInt(i: Int): String { | ||
if (i == 0) return "ZERO" | ||
return if (i > 0) { | ||
"POSITIVE=$i" | ||
} else { | ||
"NEGATIVE=${-i}" | ||
} | ||
} | ||
|
||
fun printClass() { | ||
val name = this::class.qualifiedName | ||
println(name) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/functionalTest/templates/builds/sourcesets-mpp/src/jvmTest/kotlin/TestClasses.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,10 @@ | ||
package kotlinx.kover.examples.sourcesets | ||
|
||
import kotlin.test.Test | ||
|
||
class TestClasses { | ||
@Test | ||
fun test() { | ||
ExampleClass().formatInt(50) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/functionalTest/templates/builds/sourcesets/build.gradle.kts
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,20 @@ | ||
plugins { | ||
kotlin("jvm") version "1.7.10" | ||
id("org.jetbrains.kotlinx.kover") version "0.7.0" | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
sourceSets.create("extra") | ||
|
||
kover { | ||
excludeSourceSets { | ||
names("extra") | ||
} | ||
} | ||
|
||
dependencies { | ||
testImplementation(kotlin("test")) | ||
} |
8 changes: 8 additions & 0 deletions
8
src/functionalTest/templates/builds/sourcesets/settings.gradle.kts
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,8 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
} | ||
rootProject.name = "example-source-sets" | ||
|
7 changes: 7 additions & 0 deletions
7
src/functionalTest/templates/builds/sourcesets/src/extra/kotlin/ExtraClass.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,7 @@ | ||
package kotlinx.kover.examples.sourcesets | ||
|
||
class ExtraClass { | ||
fun function() { | ||
println("Example") | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/functionalTest/templates/builds/sourcesets/src/main/kotlin/AppClasses.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,17 @@ | ||
package kotlinx.kover.examples.sourcesets | ||
|
||
class ExampleClass { | ||
fun formatInt(i: Int): String { | ||
if (i == 0) return "ZERO" | ||
return if (i > 0) { | ||
"POSITIVE=$i" | ||
} else { | ||
"NEGATIVE=${-i}" | ||
} | ||
} | ||
|
||
fun printClass() { | ||
val name = this::class.qualifiedName | ||
println(name) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/functionalTest/templates/builds/sourcesets/src/test/kotlin/TestClasses.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,10 @@ | ||
package kotlinx.kover.examples.sourcesets | ||
|
||
import kotlin.test.Test | ||
|
||
class TestClasses { | ||
@Test | ||
fun test() { | ||
ExampleClass().formatInt(50) | ||
} | ||
} |
Oops, something went wrong.