forked from MarathonLabs/marathon
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to built-in JUnit platform support
- Loading branch information
Sergey Chelombitko
committed
Aug 3, 2024
1 parent
326b44b
commit d04d12d
Showing
4 changed files
with
12 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,24 @@ | ||
import org.gradle.api.Project | ||
import org.gradle.api.tasks.testing.Test | ||
import org.gradle.kotlin.dsl.apply | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.gradle.kotlin.dsl.withType | ||
import org.junit.platform.gradle.plugin.JUnitPlatformExtension | ||
|
||
object Testing { | ||
fun configure(project: Project) { | ||
project.apply(plugin = "org.junit.platform.gradle.plugin") | ||
|
||
project.dependencies { | ||
add("testImplementation", TestLibraries.kluent) | ||
add("testImplementation", TestLibraries.mockitoKotlin) | ||
add("testImplementation", TestLibraries.spekAPI) | ||
add("testImplementation", TestLibraries.junit5) | ||
add("testImplementation", TestLibraries.junitJupiterApi) | ||
add("testRuntimeOnly", TestLibraries.junitJupiterEngine) | ||
add("testRuntimeOnly", TestLibraries.spekJUnitPlatformEngine) | ||
add("testRuntimeOnly", TestLibraries.jupiterEngine) | ||
} | ||
|
||
project.extensions.getByType(JUnitPlatformExtension::class.java).apply { | ||
filters { | ||
engines { | ||
include("spek") | ||
} | ||
project.tasks.withType<Test>().configureEach { | ||
useJUnitPlatform { | ||
includeEngines("spek", "junit-jupiter") | ||
} | ||
enableStandardTestTask = true | ||
} | ||
|
||
project.tasks.withType<Test>().all { | ||
project.tasks.getByName("check").dependsOn(this) | ||
useJUnitPlatform() | ||
} | ||
|
||
project.tasks.getByName("junitPlatformTest").outputs.upToDateWhen { false } | ||
project.tasks.getByName("test").outputs.upToDateWhen { false } | ||
} | ||
} |
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