[Native][tests] Use the single 'generateTests' task

This commit is contained in:
Dmitriy Dolovov
2021-11-11 14:50:18 +03:00
parent 54b09810f0
commit ce4d2093cc
4 changed files with 19 additions and 41 deletions
+3 -12
View File
@@ -23,20 +23,19 @@ dependencies {
}
val generationRoot = projectDir.resolve("tests-gen")
val extGenerationRoot = projectDir.resolve("ext-tests-gen")
sourceSets {
"main" { none() }
"test" {
projectDefault()
java.srcDirs(generationRoot.name, extGenerationRoot.name)
java.srcDirs(generationRoot.name)
}
}
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
apply(plugin = "idea")
idea {
module.generatedSourceDirs.addAll(listOf(generationRoot, extGenerationRoot))
module.generatedSourceDirs.addAll(listOf(generationRoot))
}
}
@@ -86,15 +85,7 @@ if (kotlinBuildProperties.isKotlinNativeEnabled) {
}
}
val generateOwnTests by generator("org.jetbrains.kotlin.generators.tests.GenerateNativeBlackboxTestsKt") {
javaLauncher.set(project.getToolchainLauncherFor(JdkMajorVersion.JDK_11))
}
val generateExtTests by generator("org.jetbrains.kotlin.generators.tests.GenerateExtNativeBlackboxTestsKt") {
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateNativeBlackboxTestsKt") {
javaLauncher.set(project.getToolchainLauncherFor(JdkMajorVersion.JDK_11))
dependsOn(":compiler:generateTestData")
}
val generateTests by tasks.creating<Task> {
dependsOn(generateOwnTests, generateExtTests)
}
@@ -1,29 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.generators.tests
import org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5
import org.jetbrains.kotlin.generators.model.annotation
import org.jetbrains.kotlin.konan.blackboxtest.AbstractNativeBlackBoxTest
import org.jetbrains.kotlin.konan.blackboxtest.group.ExtTestCaseGroupProvider
fun main() {
System.setProperty("java.awt.headless", "true")
generateTestGroupSuiteWithJUnit5 {
testGroup("native/native.tests/ext-tests-gen", "compiler/testData") {
testClass<AbstractNativeBlackBoxTest>(
suiteTestClassName = "NativeExtBlackBoxTestGenerated",
annotations = listOf(
annotation(CustomNativeBlackBoxTestCaseGroupProvider::class.java, ExtTestCaseGroupProvider::class.java)
)
) {
model("codegen/box")
model("codegen/boxInline")
}
}
}
}
@@ -6,12 +6,28 @@
package org.jetbrains.kotlin.generators.tests
import org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5
import org.jetbrains.kotlin.generators.model.annotation
import org.jetbrains.kotlin.konan.blackboxtest.AbstractNativeBlackBoxTest
import org.jetbrains.kotlin.konan.blackboxtest.group.ExtTestCaseGroupProvider
fun main() {
System.setProperty("java.awt.headless", "true")
generateTestGroupSuiteWithJUnit5 {
// External box tests.
testGroup("native/native.tests/tests-gen", "compiler/testData") {
testClass<AbstractNativeBlackBoxTest>(
suiteTestClassName = "NativeExtBlackBoxTestGenerated",
annotations = listOf(
annotation(CustomNativeBlackBoxTestCaseGroupProvider::class.java, ExtTestCaseGroupProvider::class.java)
)
) {
model("codegen/box")
model("codegen/boxInline")
}
}
// Samples (how to utilize abilities of new test infrastructure).
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
testClass<AbstractNativeBlackBoxTest> {
model("samples")