This repository was archived by the owner on Aug 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +25
-19
lines changed
src/main/kotlin/io/kotest/plugin/pitest Expand file tree Collapse file tree 7 files changed +25
-19
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,11 @@ Please create issues on the main kotest [board](https://github.com/kotest/kotest
1414
1515## Changelog
1616
17+ ### 1.2.0
18+
19+ * Minimum Pitest version is now 1.9.0.
20+ * Confirmed to work with Pitest versions up to and including 1.11.0
21+
1722### 1.1.0
1823
1924* Updated for Kotest 5.x. Now requires Kotlin 1.6
Original file line number Diff line number Diff line change 11[versions ]
22kotest = " 5.5.4"
3- pitest = " 1.8 .0"
3+ pitest = " 1.11 .0"
44coroutines = " 1.6.4"
55
66[libraries ]
Original file line number Diff line number Diff line change @@ -8,10 +8,9 @@ import java.util.Optional
88
99class KotestConfiguration : Configuration {
1010
11- override fun verifyEnvironment (): Optional <PitHelpError > = Optional .empty()
11+ override fun verifyEnvironment (): Optional <PitHelpError > = Optional .empty()
1212
13- override fun testUnitFinder (): TestUnitFinder = KotestUnitFinder ()
14-
15- override fun testSuiteFinder (): TestSuiteFinder = KotestSuiteFinder ()
13+ override fun testUnitFinder (): TestUnitFinder = KotestUnitFinder ()
1614
15+ override fun testSuiteFinder (): TestSuiteFinder = KotestSuiteFinder ()
1716}
Original file line number Diff line number Diff line change @@ -6,13 +6,15 @@ import org.pitest.testapi.TestGroupConfig
66import org.pitest.testapi.TestPluginFactory
77
88class KotestPluginFactory : TestPluginFactory {
9- override fun createTestFrameworkConfiguration (config : TestGroupConfig ? ,
10- source : ClassByteArraySource ? ,
11- excludedRunners : MutableCollection <String >? ,
12- includedTestMethods : MutableCollection <String >? ): Configuration {
13- return KotestConfiguration ()
14- }
9+ override fun createTestFrameworkConfiguration (
10+ config : TestGroupConfig ? ,
11+ source : ClassByteArraySource ? ,
12+ excludedRunners : MutableCollection <String >? ,
13+ includedTestMethods : MutableCollection <String >?
14+ ): Configuration {
15+ return KotestConfiguration ()
16+ }
1517
16- override fun description (): String = " Kotest Support"
17- override fun name (): String = " Kotest"
18- }
18+ override fun description (): String = " Kotest Support"
19+ override fun name (): String = " Kotest"
20+ }
Original file line number Diff line number Diff line change @@ -3,5 +3,5 @@ package io.kotest.plugin.pitest
33import org.pitest.testapi.TestSuiteFinder
44
55class KotestSuiteFinder : TestSuiteFinder {
6- override fun apply (t : Class <* >? ): MutableList <Class <* >> = mutableListOf ()
6+ override fun apply (t : Class <* >? ): MutableList <Class <* >> = mutableListOf ()
77}
Original file line number Diff line number Diff line change @@ -17,15 +17,15 @@ class KotestUnit(val klass: KClass<out Spec>) : TestUnit {
1717 override fun getDescription (): Description = Description (klass.toDescriptor().path().value, klass.java)
1818
1919 override fun execute (rc : ResultCollector ) = runBlocking<Unit > {
20-
2120 val listener = object : AbstractTestEngineListener () {
2221
2322 private val started = mutableSetOf< io.kotest.core.descriptors.Descriptor .TestDescriptor > ()
2423 private val completed = mutableSetOf< io.kotest.core.descriptors.Descriptor .TestDescriptor > ()
2524
2625 override suspend fun testStarted (testCase : TestCase ) {
27- if (started.add(testCase.descriptor))
26+ if (started.add(testCase.descriptor)) {
2827 rc.notifyStart(Description (testCase.descriptor.path().value, klass.java))
28+ }
2929 }
3030
3131 override suspend fun testFinished (testCase : TestCase , result : TestResult ) {
Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ package io.kotest.plugin.pitest
22
33import io.kotest.core.spec.Spec
44import org.pitest.testapi.TestUnit
5+ import org.pitest.testapi.TestUnitExecutionListener
56import org.pitest.testapi.TestUnitFinder
67import kotlin.reflect.KClass
78
89class KotestUnitFinder : TestUnitFinder {
910
10- @Suppress(" UNCHECKED_CAST" )
11- override fun findTestUnits (clazz : Class <* >): MutableList <TestUnit > {
11+ override fun findTestUnits (clazz : Class <* >, listener : TestUnitExecutionListener ? ): MutableList <TestUnit > {
1212 return when {
1313 Spec ::class .java.isAssignableFrom(clazz) -> mutableListOf (KotestUnit (clazz.kotlin as KClass <out Spec >))
1414 else -> mutableListOf ()
You can’t perform that action at this time.
0 commit comments