Skip to content

Commit

Permalink
Fix tests and improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Nov 20, 2024
1 parent 4dbd616 commit bffa0e6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ default EngineDiscoveryListener getDiscoveryListener() {
}

default OutputDirectoryProvider getOutputDirectoryProvider() {
throw new JUnitException("OutputDirectoryProvider not available");
throw new JUnitException(
"OutputDirectoryProvider not available; probably due to unaligned versions of the junit-platform-engine and junit-platform-launcher jars on the classpath/module path.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ repositories {

// grab jupiter version from system environment
val jupiterVersion = System.getenv("JUNIT_JUPITER_VERSION")
val platformVersion: String = System.getenv("JUNIT_PLATFORM_VERSION")

dependencies {
testImplementation(kotlin("stdlib-jdk8"))
testImplementation("org.junit.jupiter:junit-jupiter:$jupiterVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:$platformVersion")
}

tasks.withType<KotlinCompile>().configureEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:$jupiterVersion") {
exclude(group = "org.junit.jupiter", module = "junit-jupiter-engine")
}
}
testRuntimeOnly("org.junit.platform:junit-platform-launcher:$platformVersion")}

tasks.test {
useJUnitPlatform()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {

// grab jupiter version from system environment
val jupiterVersion: String = System.getenv("JUNIT_JUPITER_VERSION")
val vintageVersion: String = System.getenv("JUNIT_VINTAGE_VERSION")
val platformVersion: String = System.getenv("JUNIT_PLATFORM_VERSION")

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ dependencies {
exclude(group = "junit")
because("we want to override it to test against different versions")
}

val platformVersion: String = System.getenv("JUNIT_PLATFORM_VERSION")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:$platformVersion")
}

tasks.test {
Expand Down

0 comments on commit bffa0e6

Please sign in to comment.