[FIR] Implement Native test infrastructure, add FirNativeSessionFactory

This commit is contained in:
Ivan Kochurkin
2022-06-23 18:24:58 +03:00
parent 2f56b29b3f
commit 502349c594
27 changed files with 1661 additions and 40 deletions
@@ -0,0 +1,68 @@
/*
* 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.test.runners;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/diagnostics/nativeTests")
@TestDataPath("$PROJECT_ROOT")
public class FirOldFrontendNativeDiagnosticsTestGenerated extends AbstractFirNativeDiagnosticsTest {
@Test
public void testAllFilesPresentInNativeTests() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("identifiers.kt")
public void testIdentifiers() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/identifiers.kt");
}
@Test
@TestMetadata("objCName.kt")
public void testObjCName() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/objCName.kt");
}
@Test
@TestMetadata("sharedImmutable.kt")
public void testSharedImmutable() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/sharedImmutable.kt");
}
@Test
@TestMetadata("threadLocal.kt")
public void testThreadLocal() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/threadLocal.kt");
}
@Test
@TestMetadata("throws.kt")
public void testThrows() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/throws.kt");
}
@Test
@TestMetadata("throwsClash.kt")
public void testThrowsClash() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/throwsClash.kt");
}
@Test
@TestMetadata("topLevelSingleton.kt")
public void testTopLevelSingleton() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/topLevelSingleton.kt");
}
}
@@ -0,0 +1,68 @@
/*
* 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.test.runners;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/diagnostics/nativeTests")
@TestDataPath("$PROJECT_ROOT")
public class FirOldFrontendNativeDiagnosticsWithLightTreeTestGenerated extends AbstractFirNativeDiagnosticsWithLightTreeTest {
@Test
public void testAllFilesPresentInNativeTests() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/nativeTests"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("identifiers.kt")
public void testIdentifiers() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/identifiers.kt");
}
@Test
@TestMetadata("objCName.kt")
public void testObjCName() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/objCName.kt");
}
@Test
@TestMetadata("sharedImmutable.kt")
public void testSharedImmutable() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/sharedImmutable.kt");
}
@Test
@TestMetadata("threadLocal.kt")
public void testThreadLocal() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/threadLocal.kt");
}
@Test
@TestMetadata("throws.kt")
public void testThrows() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/throws.kt");
}
@Test
@TestMetadata("throwsClash.kt")
public void testThrowsClash() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/throwsClash.kt");
}
@Test
@TestMetadata("topLevelSingleton.kt")
public void testTopLevelSingleton() throws Exception {
runTest("compiler/testData/diagnostics/nativeTests/topLevelSingleton.kt");
}
}