[FIR Native] KT-58549: Ensure :dist is run before the native diagnostics
Turns out `:native:tests` prepares `:kotlin-native:dist` only.
This commit is contained in:
committed by
Space Team
parent
70605c84df
commit
a3cd7d074e
@@ -0,0 +1,34 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("jvm")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
testImplementation(projectTests(":compiler:tests-common-new"))
|
||||||
|
testImplementation(projectTests(":generators:test-generator"))
|
||||||
|
testImplementation(project(":native:kotlin-native-utils"))
|
||||||
|
testApiJUnit5()
|
||||||
|
}
|
||||||
|
|
||||||
|
val generationRoot = projectDir.resolve("tests-gen")
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
"main" { none() }
|
||||||
|
"test" {
|
||||||
|
projectDefault()
|
||||||
|
java.srcDirs(generationRoot.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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).apply {
|
||||||
|
configure {
|
||||||
|
dependsOn(":dist")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateNativeDiagnosticTestsKt") {
|
||||||
|
javaLauncher.set(project.getToolchainLauncherFor(JdkMajorVersion.JDK_11_0))
|
||||||
|
dependsOn(":compiler:generateTestData")
|
||||||
|
}
|
||||||
+1
-5
@@ -7,8 +7,6 @@ package org.jetbrains.kotlin.konan.diagnostics;
|
|||||||
|
|
||||||
import com.intellij.testFramework.TestDataPath;
|
import com.intellij.testFramework.TestDataPath;
|
||||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||||
import org.junit.jupiter.api.Tag;
|
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline;
|
|
||||||
import org.jetbrains.kotlin.test.TestMetadata;
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
import org.junit.jupiter.api.Nested;
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -16,12 +14,10 @@ import org.junit.jupiter.api.Test;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt}. DO NOT MODIFY MANUALLY */
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeDiagnosticTestsKt}. DO NOT MODIFY MANUALLY */
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("compiler/testData/diagnostics/nativeTests")
|
@TestMetadata("compiler/testData/diagnostics/nativeTests")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@Tag("frontend-fir")
|
|
||||||
@FirPipeline()
|
|
||||||
public class DiagnosticsNativeTestGenerated extends AbstractDiagnosticsNativeTest {
|
public class DiagnosticsNativeTestGenerated extends AbstractDiagnosticsNativeTest {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInNativeTests() throws Exception {
|
public void testAllFilesPresentInNativeTests() throws Exception {
|
||||||
+1
-5
@@ -7,8 +7,6 @@ package org.jetbrains.kotlin.konan.diagnostics;
|
|||||||
|
|
||||||
import com.intellij.testFramework.TestDataPath;
|
import com.intellij.testFramework.TestDataPath;
|
||||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||||
import org.junit.jupiter.api.Tag;
|
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline;
|
|
||||||
import org.jetbrains.kotlin.test.TestMetadata;
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
import org.junit.jupiter.api.Nested;
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -16,12 +14,10 @@ import org.junit.jupiter.api.Test;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt}. DO NOT MODIFY MANUALLY */
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeDiagnosticTestsKt}. DO NOT MODIFY MANUALLY */
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("compiler/testData/diagnostics/nativeTests")
|
@TestMetadata("compiler/testData/diagnostics/nativeTests")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@Tag("frontend-fir")
|
|
||||||
@FirPipeline()
|
|
||||||
public class FirLightTreeOldFrontendNativeDiagnosticsTestGenerated extends AbstractFirLightTreeNativeDiagnosticsTest {
|
public class FirLightTreeOldFrontendNativeDiagnosticsTestGenerated extends AbstractFirLightTreeNativeDiagnosticsTest {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInNativeTests() throws Exception {
|
public void testAllFilesPresentInNativeTests() throws Exception {
|
||||||
+1
-5
@@ -7,8 +7,6 @@ package org.jetbrains.kotlin.konan.diagnostics;
|
|||||||
|
|
||||||
import com.intellij.testFramework.TestDataPath;
|
import com.intellij.testFramework.TestDataPath;
|
||||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||||
import org.junit.jupiter.api.Tag;
|
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline;
|
|
||||||
import org.jetbrains.kotlin.test.TestMetadata;
|
import org.jetbrains.kotlin.test.TestMetadata;
|
||||||
import org.junit.jupiter.api.Nested;
|
import org.junit.jupiter.api.Nested;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -16,12 +14,10 @@ import org.junit.jupiter.api.Test;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt}. DO NOT MODIFY MANUALLY */
|
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeDiagnosticTestsKt}. DO NOT MODIFY MANUALLY */
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("compiler/testData/diagnostics/nativeTests")
|
@TestMetadata("compiler/testData/diagnostics/nativeTests")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@Tag("frontend-fir")
|
|
||||||
@FirPipeline()
|
|
||||||
public class FirPsiOldFrontendNativeDiagnosticsTestGenerated extends AbstractFirPsiNativeDiagnosticsTest {
|
public class FirPsiOldFrontendNativeDiagnosticsTestGenerated extends AbstractFirPsiNativeDiagnosticsTest {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInNativeTests() throws Exception {
|
public void testAllFilesPresentInNativeTests() throws Exception {
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2022 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.konan.diagnostics.AbstractDiagnosticsNativeTest
|
||||||
|
import org.jetbrains.kotlin.konan.diagnostics.AbstractFirLightTreeNativeDiagnosticsTest
|
||||||
|
import org.jetbrains.kotlin.konan.diagnostics.AbstractFirPsiNativeDiagnosticsTest
|
||||||
|
import org.jetbrains.kotlin.test.utils.CUSTOM_TEST_DATA_EXTENSION_PATTERN
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
System.setProperty("java.awt.headless", "true")
|
||||||
|
val excludedCustomTestdataPattern = CUSTOM_TEST_DATA_EXTENSION_PATTERN
|
||||||
|
|
||||||
|
generateTestGroupSuiteWithJUnit5 {
|
||||||
|
// New frontend test infrastructure tests
|
||||||
|
testGroup(testsRoot = "native/dignostic-tests/tests-gen", testDataRoot = "compiler/testData") {
|
||||||
|
testClass<AbstractDiagnosticsNativeTest> {
|
||||||
|
model("diagnostics/nativeTests", excludedPattern = excludedCustomTestdataPattern)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirPsiNativeDiagnosticsTest>(
|
||||||
|
suiteTestClassName = "FirPsiOldFrontendNativeDiagnosticsTestGenerated",
|
||||||
|
) {
|
||||||
|
model("diagnostics/nativeTests", excludedPattern = excludedCustomTestdataPattern)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirLightTreeNativeDiagnosticsTest>(
|
||||||
|
suiteTestClassName = "FirLightTreeOldFrontendNativeDiagnosticsTestGenerated",
|
||||||
|
) {
|
||||||
|
model("diagnostics/nativeTests", excludedPattern = excludedCustomTestdataPattern)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
-28
@@ -17,16 +17,11 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.group.*
|
|||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.DisabledTestsIfProperty
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.DisabledTestsIfProperty
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline
|
||||||
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UsePartialLinkage
|
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UsePartialLinkage
|
||||||
import org.jetbrains.kotlin.konan.diagnostics.AbstractDiagnosticsNativeTest
|
|
||||||
import org.jetbrains.kotlin.konan.diagnostics.AbstractFirLightTreeNativeDiagnosticsTest
|
|
||||||
import org.jetbrains.kotlin.konan.diagnostics.AbstractFirPsiNativeDiagnosticsTest
|
|
||||||
import org.jetbrains.kotlin.test.TargetBackend
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
import org.jetbrains.kotlin.test.utils.CUSTOM_TEST_DATA_EXTENSION_PATTERN
|
|
||||||
import org.junit.jupiter.api.Tag
|
import org.junit.jupiter.api.Tag
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
System.setProperty("java.awt.headless", "true")
|
System.setProperty("java.awt.headless", "true")
|
||||||
val excludedCustomTestdataPattern = CUSTOM_TEST_DATA_EXTENSION_PATTERN
|
|
||||||
|
|
||||||
generateTestGroupSuiteWithJUnit5 {
|
generateTestGroupSuiteWithJUnit5 {
|
||||||
// Codegen box tests.
|
// Codegen box tests.
|
||||||
@@ -221,29 +216,6 @@ fun main() {
|
|||||||
model("lldb")
|
model("lldb")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// New frontend test infrastructure tests
|
|
||||||
testGroup(testsRoot = "native/native.tests/tests-gen", testDataRoot = "compiler/testData") {
|
|
||||||
testClass<AbstractDiagnosticsNativeTest>(
|
|
||||||
annotations = listOf(*frontendFir()),
|
|
||||||
) {
|
|
||||||
model("diagnostics/nativeTests", excludedPattern = excludedCustomTestdataPattern)
|
|
||||||
}
|
|
||||||
|
|
||||||
testClass<AbstractFirPsiNativeDiagnosticsTest>(
|
|
||||||
suiteTestClassName = "FirPsiOldFrontendNativeDiagnosticsTestGenerated",
|
|
||||||
annotations = listOf(*frontendFir()),
|
|
||||||
) {
|
|
||||||
model("diagnostics/nativeTests", excludedPattern = excludedCustomTestdataPattern)
|
|
||||||
}
|
|
||||||
|
|
||||||
testClass<AbstractFirLightTreeNativeDiagnosticsTest>(
|
|
||||||
suiteTestClassName = "FirLightTreeOldFrontendNativeDiagnosticsTestGenerated",
|
|
||||||
annotations = listOf(*frontendFir()),
|
|
||||||
) {
|
|
||||||
model("diagnostics/nativeTests", excludedPattern = excludedCustomTestdataPattern)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ include ":benchmarks",
|
|||||||
":js:js.dce",
|
":js:js.dce",
|
||||||
":js:js.tests",
|
":js:js.tests",
|
||||||
":native:kotlin-native-utils",
|
":native:kotlin-native-utils",
|
||||||
|
":native:dignostic-tests",
|
||||||
":native:frontend.native",
|
":native:frontend.native",
|
||||||
":native:kotlin-klib-commonizer",
|
":native:kotlin-klib-commonizer",
|
||||||
":native:kotlin-klib-commonizer-api",
|
":native:kotlin-klib-commonizer-api",
|
||||||
|
|||||||
Reference in New Issue
Block a user