Skip to content

Commit 355cbc3

Browse files
committed
Updating pitest version
1 parent cd48dde commit 355cbc3

File tree

7 files changed

+25
-19
lines changed

7 files changed

+25
-19
lines changed

README.md

+5
Original file line numberDiff line numberDiff 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

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
kotest = "5.5.4"
3-
pitest = "1.8.0"
3+
pitest = "1.11.0"
44
coroutines = "1.6.4"
55

66
[libraries]

src/main/kotlin/io/kotest/plugin/pitest/KotestConfiguration.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import java.util.Optional
88

99
class 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
}

src/main/kotlin/io/kotest/plugin/pitest/KotestPluginFactory.kt

+11-9
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import org.pitest.testapi.TestGroupConfig
66
import org.pitest.testapi.TestPluginFactory
77

88
class 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+
}

src/main/kotlin/io/kotest/plugin/pitest/KotestSuiteFinder.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ package io.kotest.plugin.pitest
33
import org.pitest.testapi.TestSuiteFinder
44

55
class KotestSuiteFinder : TestSuiteFinder {
6-
override fun apply(t: Class<*>?): MutableList<Class<*>> = mutableListOf()
6+
override fun apply(t: Class<*>?): MutableList<Class<*>> = mutableListOf()
77
}

src/main/kotlin/io/kotest/plugin/pitest/KotestUnit.kt

+2-2
Original file line numberDiff line numberDiff 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) {

src/main/kotlin/io/kotest/plugin/pitest/KotestUnitFinder.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package io.kotest.plugin.pitest
22

33
import io.kotest.core.spec.Spec
44
import org.pitest.testapi.TestUnit
5+
import org.pitest.testapi.TestUnitExecutionListener
56
import org.pitest.testapi.TestUnitFinder
67
import kotlin.reflect.KClass
78

89
class 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()

0 commit comments

Comments
 (0)