Files
kotlin-fork/native/native.tests/build.gradle.kts
T
Dmitriy Dolovov 0de06757ca [K/N][tests] Rework tags for K/N tests
Use plain combinations of tags, examples:
* codegen/box w/o FIR: 'codegen & !frontend-fir'
* codegen/box with FIR: 'codegen & frontend-fir'

Avoid using tags with multiple aspects in their names, examples:
* 'codegenK1'
* 'firCodegen'

The obsolete tags to be removed but still used in TeamCity configurations:
* 'stdlibK2'
* 'kotlin-testK2'
* 'codegenK2'
* 'k2libContents'
* 'firInfrastructure'
2023-05-03 11:49:43 +00:00

71 lines
3.1 KiB
Kotlin

import org.jetbrains.kotlin.ideaExt.idea
plugins {
kotlin("jvm")
id("jps-compatible")
}
project.configureJvmToolchain(JdkMajorVersion.JDK_11_0)
dependencies {
testImplementation(kotlinStdlib())
testImplementation(commonDependency("org.jetbrains.kotlin:kotlin-reflect")) { isTransitive = false }
testImplementation(intellijCore())
testImplementation(commonDependency("commons-lang:commons-lang"))
testImplementation(commonDependency("org.jetbrains.teamcity:serviceMessages"))
testImplementation(project(":kotlin-compiler-runner-unshaded"))
testImplementation(projectTests(":compiler:tests-common"))
testImplementation(projectTests(":compiler:tests-common-new"))
testImplementation(projectTests(":compiler:test-infrastructure"))
testImplementation(projectTests(":generators:test-generator"))
testImplementation(project(":native:kotlin-native-utils"))
testImplementation(project(":native:executors"))
testApiJUnit5()
testImplementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false }
testRuntimeOnly(commonDependency("org.jetbrains.intellij.deps:trove4j"))
testRuntimeOnly(commonDependency("org.jetbrains.intellij.deps.fastutil:intellij-deps-fastutil"))
}
val generationRoot = projectDir.resolve("tests-gen")
sourceSets {
"main" { none() }
"test" {
projectDefault()
java.srcDirs(generationRoot.name)
}
}
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
apply(plugin = "idea")
idea {
module.generatedSourceDirs.addAll(listOf(generationRoot))
}
}
// Tasks that run different sorts of tests. Most frequent use case: running specific tests at TeamCity.
val infrastructureTest = nativeTest("infrastructureTest", "infrastructure")
val codegenBoxTest = nativeTest("codegenBoxTest", "codegen & !frontend-fir")
val codegenBoxK2Test = nativeTest("codegenBoxK2Test", "codegen & frontend-fir")
val stdlibTest = nativeTest("stdlibTest", "stdlib & !frontend-fir")
val stdlibK2Test = nativeTest("stdlibK2Test", "stdlib & frontend-fir")
val kotlinTestLibraryTest = nativeTest("kotlinTestLibraryTest", "kotlin-test & !frontend-fir")
val kotlinTestLibraryK2Test = nativeTest("kotlinTestLibraryK2Test", "kotlin-test & frontend-fir")
val partialLinkageTest = nativeTest("partialLinkageTest", "partial-linkage")
val cinteropTest = nativeTest("cinteropTest", "cinterop")
val debuggerTest = nativeTest("debuggerTest", "debugger")
val cachesTest = nativeTest("cachesTest", "caches")
val klibContentsTest = nativeTest("klibContentsTest", "klib-contents & !frontend-fir")
val klibContentsK2Test = nativeTest("klibContentsK2Test", "klib-contents & frontend-fir")
val testTags = findProperty("kotlin.native.tests.tags")?.toString()
// Note: arbitrary JUnit tag expressions can be used in this property.
// See https://junit.org/junit5/docs/current/user-guide/#running-tests-tag-expressions
val test by nativeTest("test", testTags)
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt") {
javaLauncher.set(project.getToolchainLauncherFor(JdkMajorVersion.JDK_11_0))
dependsOn(":compiler:generateTestData")
}