-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add basic support for JUnit 5 #35 This is missing the ability to mix and match parameters supported by Burst with parameters supported by JUnit 5. * Support mixing and matching annotations * Be more functional * Spotless * Update changelog --------- Co-authored-by: Jesse Wilson <[email protected]>
- Loading branch information
1 parent
30ad9bc
commit eb0be6b
Showing
10 changed files
with
151 additions
and
19 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
41 changes: 41 additions & 0 deletions
41
burst-gradle-plugin/src/test/projects/junit5/build.gradle.kts
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile | ||
|
||
buildscript { | ||
repositories { | ||
maven { | ||
url = file("$rootDir/../../../../../build/testMaven").toURI() | ||
} | ||
mavenCentral() | ||
google() | ||
} | ||
dependencies { | ||
classpath("app.cash.burst:burst-gradle-plugin:${project.property("burstVersion")}") | ||
classpath(libs.kotlin.gradlePlugin) | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
maven { | ||
url = file("$rootDir/../../../../../build/testMaven").toURI() | ||
} | ||
mavenCentral() | ||
google() | ||
} | ||
|
||
tasks.withType(JavaCompile::class.java).configureEach { | ||
sourceCompatibility = "1.8" | ||
targetCompatibility = "1.8" | ||
} | ||
|
||
tasks.withType(KotlinJvmCompile::class.java).configureEach { | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_1_8) | ||
} | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
burst-gradle-plugin/src/test/projects/junit5/lib/build.gradle.kts
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins { | ||
kotlin("jvm") | ||
id("app.cash.burst") | ||
} | ||
|
||
dependencies { | ||
testImplementation(kotlin("test")) | ||
testImplementation(libs.junit) | ||
testRuntimeOnly(libs.junit.vintage.engine) | ||
} |
32 changes: 32 additions & 0 deletions
32
burst-gradle-plugin/src/test/projects/junit5/lib/src/test/kotlin/CoffeeTest.kt
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import app.cash.burst.Burst | ||
import kotlin.test.BeforeTest | ||
import kotlin.test.Test | ||
|
||
@Burst | ||
class CoffeeTest( | ||
private val espresso: Espresso, | ||
) { | ||
@BeforeTest | ||
fun setUp() { | ||
println("set up $espresso") | ||
} | ||
|
||
@kotlin.test.Test | ||
fun kotlinTestTest(dairy: Dairy) { | ||
println("@kotlin.test.Test running $espresso $dairy") | ||
} | ||
|
||
@org.junit.Test | ||
fun orgJunitTest(dairy: Dairy) { | ||
println("@org.junit.Test running $espresso $dairy") | ||
} | ||
|
||
@org.junit.jupiter.api.Test | ||
fun orgJunitJupiterApiTest(dairy: Dairy) { | ||
println("@org.junit.jupiter.api.Test running $espresso $dairy") | ||
} | ||
} | ||
|
||
enum class Espresso { Decaf, Regular, Double } | ||
|
||
enum class Dairy { None, Milk, Oat } |
9 changes: 9 additions & 0 deletions
9
burst-gradle-plugin/src/test/projects/junit5/settings.gradle.kts
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../../../../../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
|
||
include(":lib") |
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
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