Skip to content
This repository was archived by the owner on Aug 19, 2020. It is now read-only.

Commit 02abcbf

Browse files
committed
add example configuration for the JUnit5 test execution
1 parent afe080f commit 02abcbf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

samples/buildSrc-test-junit5/buildSrc/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ dependencies {
1111
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.3.2")
1212
}
1313

14-
tasks.test {
15-
useJUnitPlatform()
14+
tasks.withType<Test>().configureEach {
15+
useJUnitPlatform {
16+
includeTags("fooTag")
17+
}
1618
}

samples/buildSrc-test-junit5/buildSrc/src/test/kotlin/greeting/GreeterTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ package greeting
22

33
import org.junit.jupiter.api.Test;
44
import org.junit.jupiter.api.Assertions.assertEquals
5+
import org.junit.jupiter.api.Tag
56

67
class GreeterTest {
78
@Test
9+
@Tag("fooTag")
810
fun canSayHelloTo() {
911
assertEquals("Hello Gradle", sayHelloTo("Gradle"))
1012
}

0 commit comments

Comments
 (0)