| import kotlin.io.path.createTempDirectory |
| |
| plugins { |
| kotlin("jvm") |
| id("jps-compatible") |
| id("compiler-tests-convention") |
| id("test-inputs-check") |
| } |
| |
| dependencies { |
| testApi(project(":kotlin-scripting-compiler")) |
| testApi(projectTests(":compiler:tests-common")) |
| testImplementation(intellijCore()) |
| testApi(platform(libs.junit.bom)) |
| testCompileOnly(libs.junit4) |
| testImplementation("org.junit.jupiter:junit-jupiter:${libs.versions.junit5.get()}") |
| testRuntimeOnly(libs.junit.vintage.engine) |
| testRuntimeOnly(libs.junit.platform.launcher) |
| testApi(projectTests(":generators:test-generator")) |
| testRuntimeOnly(toolsJar()) |
| } |
| |
| sourceSets { |
| "main" {} |
| "test" { |
| projectDefault() |
| generatedTestDir() |
| } |
| } |
| |
| compilerTests { |
| testData(project(":compiler").isolated, "testData/loadJava") |
| testData(project(":compiler").isolated, "testData/loadJava8") |
| testData(project(":compiler").isolated, "testData/resolvedCalls/enhancedSignatures") |
| testData(project(":compiler").isolated, "testData/builtin-classes") |
| withScriptRuntime() |
| withScriptingPlugin() |
| withTestJar() |
| withAnnotations() |
| withMockJdkAnnotationsJar() |
| withThirdPartyJava8Annotations() |
| } |
| |
| |
| projectTest( |
| parallel = true, |
| defineJDKEnvVariables = listOf(JdkMajorVersion.JDK_21_0) |
| ) { |
| useJUnitPlatform() |
| systemProperty("kotlin.test.script.classpath", testSourceSet.output.classesDirs.joinToString(File.pathSeparator)) |
| } |
| |
| val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateJava8TestsKt") |
| val generateKotlinUseSiteFromJavaOnesForJspecifyTests by generator("org.jetbrains.kotlin.generators.tests.GenerateKotlinUseSitesFromJavaOnesForJspecifyTestsKt") |
| |
| tasks.register<Exec>("downloadJspecifyTests") { |
| val tmpDirPath = createTempDirectory().toAbsolutePath().toString() |
| doFirst { |
| executable("git") |
| args("clone", "https://github.com/jspecify/jspecify/", tmpDirPath) |
| } |
| doLast { |
| copy { |
| from("$tmpDirPath/samples") |
| into("${project.rootDir}/compiler/testData/foreignAnnotationsJava8/tests/jspecify/java") |
| } |
| } |
| } |
| |
| tasks.test { |
| exclude("**/*JspecifyAnnotationsTestGenerated*") |
| } |
| tasks.register<Test>("jspecifyTests") { |
| workingDir(project.rootDir) |
| include("**/*JspecifyAnnotationsTestGenerated*") |
| } |
| |
| testsJar() |