Tests: remove bytecode listing tests for old JVM backend

These tests are mostly used to check ABI in case you're compiling a
library or library-like code, which is no longer possible (since old JVM
backend is only used in the IDE).
This commit is contained in:
Alexander Udalov
2023-11-01 15:44:42 +01:00
committed by Space Team
parent 56936e2012
commit 1cf04916d6
8 changed files with 10 additions and 2725 deletions
@@ -18,14 +18,9 @@ package org.jetbrains.kotlin.allopen
import org.jetbrains.kotlin.test.Constructor
import org.jetbrains.kotlin.test.FirParser
import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.test.backend.classic.ClassicBackendInput
import org.jetbrains.kotlin.test.backend.classic.ClassicJvmBackendFacade
import org.jetbrains.kotlin.test.backend.ir.IrBackendInput
import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import org.jetbrains.kotlin.test.directives.configureFirParser
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2ClassicBackendConverter
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2IrConverter
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendOutputArtifact
@@ -35,10 +30,9 @@ import org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact
import org.jetbrains.kotlin.test.model.*
import org.jetbrains.kotlin.test.runners.codegen.AbstractBytecodeListingTestBase
abstract class AbstractBytecodeListingTestForAllOpenBase<R : ResultingArtifact.FrontendOutput<R>, I : ResultingArtifact.BackendInput<I>>(
targetBackend: TargetBackend,
abstract class AbstractBytecodeListingTestForAllOpenBase<R : ResultingArtifact.FrontendOutput<R>>(
targetFrontend: FrontendKind<R>
) : AbstractBytecodeListingTestBase<R, I>(targetBackend, targetFrontend){
) : AbstractBytecodeListingTestBase<R>(targetFrontend) {
override fun configure(builder: TestConfigurationBuilder) {
super.configure(builder)
builder.apply {
@@ -47,40 +41,20 @@ abstract class AbstractBytecodeListingTestForAllOpenBase<R : ResultingArtifact.F
}
}
open class AbstractBytecodeListingTestForAllOpen :
AbstractBytecodeListingTestForAllOpenBase<ClassicFrontendOutputArtifact, ClassicBackendInput>(
TargetBackend.JVM, FrontendKinds.ClassicFrontend
) {
override val frontendFacade: Constructor<FrontendFacade<ClassicFrontendOutputArtifact>>
get() = ::ClassicFrontendFacade
override val frontendToBackendConverter: Constructor<Frontend2BackendConverter<ClassicFrontendOutputArtifact, ClassicBackendInput>>
get() = ::ClassicFrontend2ClassicBackendConverter
override val backendFacade: Constructor<BackendFacade<ClassicBackendInput, BinaryArtifacts.Jvm>>
get() = ::ClassicJvmBackendFacade
}
open class AbstractIrBytecodeListingTestForAllOpen :
AbstractBytecodeListingTestForAllOpenBase<ClassicFrontendOutputArtifact, IrBackendInput>(
TargetBackend.JVM_IR, FrontendKinds.ClassicFrontend
) {
AbstractBytecodeListingTestForAllOpenBase<ClassicFrontendOutputArtifact>(FrontendKinds.ClassicFrontend) {
override val frontendFacade: Constructor<FrontendFacade<ClassicFrontendOutputArtifact>>
get() = ::ClassicFrontendFacade
override val frontendToBackendConverter: Constructor<Frontend2BackendConverter<ClassicFrontendOutputArtifact, IrBackendInput>>
get() = ::ClassicFrontend2IrConverter
override val backendFacade: Constructor<BackendFacade<IrBackendInput, BinaryArtifacts.Jvm>>
get() = ::JvmIrBackendFacade
}
open class AbstractFirPsiBytecodeListingTestForAllOpen :
AbstractBytecodeListingTestForAllOpenBase<FirOutputArtifact, IrBackendInput>(
TargetBackend.JVM_IR, FrontendKinds.FIR
) {
AbstractBytecodeListingTestForAllOpenBase<FirOutputArtifact>(FrontendKinds.FIR) {
override val frontendFacade: Constructor<FrontendFacade<FirOutputArtifact>>
get() = ::FirFrontendFacade
override val frontendToBackendConverter: Constructor<Frontend2BackendConverter<FirOutputArtifact, IrBackendInput>>
get() = ::Fir2IrJvmResultsConverter
override val backendFacade: Constructor<BackendFacade<IrBackendInput, BinaryArtifacts.Jvm>>
get() = ::JvmIrBackendFacade
override fun configure(builder: TestConfigurationBuilder) {
super.configure(builder)
@@ -1,123 +0,0 @@
/*
* Copyright 2010-2023 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.allopen;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TargetBackend;
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 org.jetbrains.kotlin.generators.tests.GenerateTestsKt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("plugins/allopen/testData/bytecodeListing")
@TestDataPath("$PROJECT_ROOT")
public class BytecodeListingTestForAllOpenGenerated extends AbstractBytecodeListingTestForAllOpen {
@Test
public void testAllFilesPresentInBytecodeListing() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/allopen/testData/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JVM, true);
}
@Test
@TestMetadata("allOpenOnNotClasses.kt")
public void testAllOpenOnNotClasses() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/allOpenOnNotClasses.kt");
}
@Test
@TestMetadata("alreadyOpen.kt")
public void testAlreadyOpen() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/alreadyOpen.kt");
}
@Test
@TestMetadata("annotationMembers.kt")
public void testAnnotationMembers() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/annotationMembers.kt");
}
@Test
@TestMetadata("anonymousObject.kt")
public void testAnonymousObject() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/anonymousObject.kt");
}
@Test
@TestMetadata("explicitFinal.kt")
public void testExplicitFinal() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/explicitFinal.kt");
}
@Test
@TestMetadata("metaAnnotation_differentModules.kt")
public void testMetaAnnotation_differentModules() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/metaAnnotation_differentModules.kt");
}
@Test
@TestMetadata("metaAnnotation_sameModule.kt")
public void testMetaAnnotation_sameModule() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/metaAnnotation_sameModule.kt");
}
@Test
@TestMetadata("nestedClass.kt")
public void testNestedClass() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/nestedClass.kt");
}
@Test
@TestMetadata("nestedInner.kt")
public void testNestedInner() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/nestedInner.kt");
}
@Test
@TestMetadata("noAllOpen.kt")
public void testNoAllOpen() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/noAllOpen.kt");
}
@Test
@TestMetadata("privateMembers.kt")
public void testPrivateMembers() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/privateMembers.kt");
}
@Test
@TestMetadata("sealed.kt")
public void testSealed() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/sealed.kt");
}
@Test
@TestMetadata("severalAllOpen.kt")
public void testSeveralAllOpen() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/severalAllOpen.kt");
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/simple.kt");
}
@Test
@TestMetadata("springAnnotations.kt")
public void testSpringAnnotations() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/springAnnotations.kt");
}
@Test
@TestMetadata("superClassAnnotation.kt")
public void testSuperClassAnnotation() throws Exception {
runTest("plugins/allopen/testData/bytecodeListing/superClassAnnotation.kt");
}
}