@@ -2,6 +2,7 @@ plugins {
2
2
kotlin(" jvm" )
3
3
id(" jps-compatible" )
4
4
id(" java-test-fixtures" )
5
+ id(" project-tests-convention" )
5
6
}
6
7
7
8
dependencies {
@@ -46,50 +47,52 @@ sourceSets {
46
47
47
48
testsJar {}
48
49
49
- // Tasks that run different sorts of tests. Most frequent use case: running specific tests at TeamCity.
50
- val infrastructureTest = nativeTest(" infrastructureTest" , " infrastructure" )
51
- val stdlibTest = nativeTest(" stdlibTest" , " stdlib" )
52
- val kotlinTestLibraryTest = nativeTest(" kotlinTestLibraryTest" , " kotlin-test" )
53
- val partialLinkageTest = nativeTest(" partialLinkageTest" , " partial-linkage" )
54
- val cinteropTest = nativeTest(" cinteropTest" , " cinterop" )
55
- val debuggerTest = nativeTest(" debuggerTest" , " debugger" )
56
- val cachesTest = nativeTest(" cachesTest" , " caches" )
57
- val klibTest = nativeTest(" klibTest" , " klib" )
58
- val standaloneTest = nativeTest(" standaloneTest" , " standalone" )
59
- val gcTest = nativeTest(" gcTest" , " gc" )
50
+ projectTests {
51
+ // Tasks that run different sorts of tests. Most frequent use case: running specific tests at TeamCity.
52
+ nativeTestTask(" infrastructureTest" , " infrastructure" )
53
+ nativeTestTask(" stdlibTest" , " stdlib" )
54
+ nativeTestTask(" kotlinTestLibraryTest" , " kotlin-test" )
55
+ nativeTestTask(" partialLinkageTest" , " partial-linkage" )
56
+ nativeTestTask(" cinteropTest" , " cinterop" )
57
+ nativeTestTask(" debuggerTest" , " debugger" )
58
+ nativeTestTask(" cachesTest" , " caches" )
59
+ nativeTestTask(" klibTest" , " klib" )
60
+ nativeTestTask(" standaloneTest" , " standalone" )
61
+ nativeTestTask(" gcTest" , " gc" )
60
62
61
- val testTags = findProperty(" kotlin.native.tests.tags" )?.toString()
62
- // Note: arbitrary JUnit tag expressions can be used in this property.
63
- // See https://junit.org/junit5/docs/current/user-guide/#running-tests-tag-expressions
64
- val test by nativeTest(
65
- " test" ,
66
- testTags,
67
- requirePlatformLibs = true ,
68
- defineJDKEnvVariables = listOf (
69
- JdkMajorVersion .JDK_1_8 , // required in CompilerOutputTest via AbstractCliTest.getNormalizedCompilerOutput
70
- JdkMajorVersion .JDK_11_0 , // required in CompilerOutputTest via AbstractCliTest.getNormalizedCompilerOutput
71
- JdkMajorVersion .JDK_17_0 , // required in CompilerOutputTest via AbstractCliTest.getNormalizedCompilerOutput
72
- JdkMajorVersion .JDK_21_0 ,
73
- )
74
- ) {
75
- options {
76
- // See [org.jetbrains.kotlin.konan.test.KlibCrossCompilationIdentityTest.FULL_CROSS_DIST_ENABLED_PROPERTY]
77
- // See also kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/nativeFullCrossDist.kt
78
- systemProperty(
79
- " kotlin.native.internal.fullCrossDistEnabled" ,
80
- kotlinBuildProperties.getOrNull(" kotlin.native.pathToDarwinDist" ) != null
63
+ val testTags = findProperty(" kotlin.native.tests.tags" )?.toString()
64
+ // Note: arbitrary JUnit tag expressions can be used in this property.
65
+ // See https://junit.org/junit5/docs/current/user-guide/#running-tests-tag-expressions
66
+ nativeTestTask(
67
+ " test" ,
68
+ testTags,
69
+ requirePlatformLibs = true ,
70
+ defineJDKEnvVariables = listOf (
71
+ JdkMajorVersion .JDK_1_8 , // required in CompilerOutputTest via AbstractCliTest.getNormalizedCompilerOutput
72
+ JdkMajorVersion .JDK_11_0 , // required in CompilerOutputTest via AbstractCliTest.getNormalizedCompilerOutput
73
+ JdkMajorVersion .JDK_17_0 , // required in CompilerOutputTest via AbstractCliTest.getNormalizedCompilerOutput
74
+ JdkMajorVersion .JDK_21_0 ,
81
75
)
82
- }
76
+ ) {
77
+ options {
78
+ // See [org.jetbrains.kotlin.konan.test.KlibCrossCompilationIdentityTest.FULL_CROSS_DIST_ENABLED_PROPERTY]
79
+ // See also kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/nativeFullCrossDist.kt
80
+ systemProperty(
81
+ " kotlin.native.internal.fullCrossDistEnabled" ,
82
+ kotlinBuildProperties.getOrNull(" kotlin.native.pathToDarwinDist" ) != null
83
+ )
84
+ }
83
85
84
- // To workaround KTI-2421, we make these tests run on JDK 11 instead of the project-default JDK 8.
85
- // Kotlin test infra uses reflection to access JDK internals.
86
- // With JDK 11, some JVM args are required to silence the warnings caused by that:
87
- jvmArgs(" --add-opens=java.base/java.io=ALL-UNNAMED" )
88
- }
86
+ // To workaround KTI-2421, we make these tests run on JDK 11 instead of the project-default JDK 8.
87
+ // Kotlin test infra uses reflection to access JDK internals.
88
+ // With JDK 11, some JVM args are required to silence the warnings caused by that:
89
+ jvmArgs(" --add-opens=java.base/java.io=ALL-UNNAMED" )
90
+ }
89
91
90
- val generateTests by generator(" org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt" ) {
91
- javaLauncher.set(project.getToolchainLauncherFor(JdkMajorVersion .JDK_11_0 ))
92
- dependsOn(" :compiler:generateTestData" )
92
+ testGenerator(" org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt" ) {
93
+ javaLauncher.set(project.getToolchainLauncherFor(JdkMajorVersion .JDK_11_0 ))
94
+ dependsOn(" :compiler:generateTestData" )
95
+ }
93
96
}
94
97
95
98
optInToK1Deprecation()
0 commit comments