Add @GradleWithJdkTest annotation.

Adding this annotation to the test will provide requested JDKs + Gradle
versions matrix as test parameter.

It is also possible to filter out supported by Gradle version JDKs.

^KT-45745 In Progress
This commit is contained in:
Yahor Berdnikau
2021-10-22 16:31:51 +02:00
committed by Space
parent ca3e1b18dc
commit 98791000bf
5 changed files with 186 additions and 64 deletions
@@ -85,6 +85,23 @@ plugins {
A bunch of additional useful assertions available to use, such as file assertions, output assertions and task assertions. If you want to
add a new assertion, add as a reviewer someone from Kotlin build tools team.
##### Additional test helpers
Whenever you need to test combination of different JDKs and Gradle versions - you could use `@GradleWithJdkTest` instead of `@GradleTest`.
Then test method will receive requires JDKs as a second parameter:
```kotlin
@JdkVersions(version = [JavaVersion.VERSION_11, JavaVersion.VERSION_17])
@GradleWithJdkTest
fun someTest(
gradleVersion: GradleVersion,
providedJdk: JdkVersions.ProvidedJdk
) {
project("simple", gradleVersion, buildJdk = providedJdk.location) {
build("assemble")
}
}
```
##### Deprecated tests setup
When you create a new test, figure out which Gradle versions it is supposed to run on. Then, when you instantiate a test project, specify one of: