mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Adjust KotlinTestRunner.
This commit is contained in:
parent
a80e19d53a
commit
9a249c2a6c
2 changed files with 9 additions and 1 deletions
|
@ -18,6 +18,8 @@ abstract class GenericTestRunner: ITestRunnerContributor {
|
|||
abstract fun args(project: Project, context: KobaltContext, classpath: List<IClasspathDependency>,
|
||||
testConfig: TestConfig) : List<String>
|
||||
|
||||
open fun filterTestClasses(classes: List<String>) : List<String> = classes
|
||||
|
||||
override fun run(project: Project, context: KobaltContext, configName: String,
|
||||
classpath: List<IClasspathDependency>)
|
||||
= TaskResult(runTests(project, context, classpath, configName))
|
||||
|
@ -53,7 +55,7 @@ abstract class GenericTestRunner: ITestRunnerContributor {
|
|||
// }
|
||||
|
||||
context.logger.log(project.name, 2, "Found ${result.size} test classes")
|
||||
return result.map { it.second }
|
||||
return filterTestClasses(result.map { it.second })
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,5 +6,11 @@ package com.beust.kobalt.internal
|
|||
*/
|
||||
class KotlinTestRunner : JUnitRunner() {
|
||||
override val dependencyName = "io.kotlintest"
|
||||
|
||||
/**
|
||||
* KotlinTestRunner runs tests in the init{} initializer, so ignore all the extra
|
||||
* classes generated by the Kotlin compiler.
|
||||
*/
|
||||
override fun filterTestClasses(classes: List<String>) = classes.filter { ! it.contains("$") }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue