- JUnit dependencies
- Running native tests
- Custom test suites
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
testImplementation 'junit:junit:4.13.2'
}
test {
useJUnitPlatform()
}./gradlew nativeTestThe output binary is located at:
build/native/nativeTestCompile/<imageName>
Register additional test binaries for integration tests or other test source sets:
graalvmNative {
registerTestBinary("integTest") {
usingSourceSet(sourceSets.integTest)
forTestTask(tasks.named('integTest'))
}
}This creates two tasks:
nativeIntegTestCompile— builds the native test binarynativeIntegTest— runs it