Migrate bytecodeListing tests to new test infrastructure

This commit is contained in:
Alexander Udalov
2021-04-22 18:46:09 +02:00
parent 7e170770ea
commit 0c3f2eefe0
34 changed files with 955 additions and 487 deletions
@@ -1,31 +0,0 @@
@kotlin.Metadata
public final class Foo$DefaultImpls {
// source: 'privateFunWithDefaultArg2.kt'
public deprecated static @java.lang.Deprecated @org.jetbrains.annotations.NotNull method bar(@org.jetbrains.annotations.NotNull p0: Foo): java.lang.String
public final inner class Foo$DefaultImpls
}
@kotlin.Metadata
public interface Foo {
// source: 'privateFunWithDefaultArg2.kt'
public synthetic static method access$bar$jd(p0: Foo): java.lang.String
public @org.jetbrains.annotations.NotNull method bar(): java.lang.String
public synthetic static method foo$default(p0: Foo, p1: java.lang.String, p2: int, p3: java.lang.Object): java.lang.String
private method foo(p0: java.lang.String): java.lang.String
public final inner class Foo$DefaultImpls
}
@kotlin.Metadata
public final class PrivateFunWithDefaultArg2Kt$box$1 {
// source: 'privateFunWithDefaultArg2.kt'
enclosing method PrivateFunWithDefaultArg2Kt.box()Ljava/lang/String;
inner (anonymous) class PrivateFunWithDefaultArg2Kt$box$1
method <init>(): void
}
@kotlin.Metadata
public final class PrivateFunWithDefaultArg2Kt {
// source: 'privateFunWithDefaultArg2.kt'
inner (anonymous) class PrivateFunWithDefaultArg2Kt$box$1
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
}
@@ -10,8 +10,8 @@ public annotation class Anno {
public final class C {
// source: 'internalPropertyOrTypealias.kt'
public method <init>(): void
public synthetic deprecated static @Anno method getProperty$test_module$annotations(): void
public final method getProperty$test_module(): int
public synthetic deprecated static @Anno method getProperty$main$annotations(): void
public final method getProperty$main(): int
}
@kotlin.Metadata
@@ -10,7 +10,7 @@ public final class Test {
public method getSize(): int
public method isEmpty(): boolean
public @org.jetbrains.annotations.NotNull method iterator(): java.util.Iterator
public final method remove$test_module(p0: java.lang.Object): boolean
public final method remove$main(p0: java.lang.Object): boolean
public method removeAll(p0: java.util.Collection): boolean
public method retainAll(p0: java.util.Collection): boolean
public bridge final method size(): int
@@ -10,7 +10,7 @@ public final class Test {
public method getSize(): int
public method isEmpty(): boolean
public @org.jetbrains.annotations.NotNull method iterator(): java.util.Iterator
public final method remove$test_module(p0: java.lang.Object): boolean
public final method remove$main(p0: java.lang.Object): boolean
public bridge final method remove(p0: java.lang.Object): boolean
public method removeAll(p0: java.util.Collection): boolean
public method retainAll(p0: java.util.Collection): boolean
@@ -15,7 +15,7 @@ public final class InternalToArray {
public method removeAll(p0: java.util.Collection): boolean
public method retainAll(p0: java.util.Collection): boolean
public bridge final method size(): int
public final @org.jetbrains.annotations.NotNull method toArray$test_module(): java.lang.Integer[]
public final @org.jetbrains.annotations.NotNull method toArray$main(): java.lang.Integer[]
public method toArray(p0: java.lang.Object[]): java.lang.Object[]
}
@@ -15,7 +15,7 @@ public final class InternalToArray {
public method removeAll(p0: java.util.Collection): boolean
public method retainAll(p0: java.util.Collection): boolean
public bridge final method size(): int
public final @org.jetbrains.annotations.NotNull method toArray$test_module(): java.lang.Integer[]
public final @org.jetbrains.annotations.NotNull method toArray$main(): java.lang.Integer[]
public final method toArray(): java.lang.Object[]
public method toArray(p0: java.lang.Object[]): java.lang.Object[]
}
@@ -15,6 +15,6 @@ public final class InternalGenericToArray {
public method removeAll(p0: java.util.Collection): boolean
public method retainAll(p0: java.util.Collection): boolean
public bridge final method size(): int
public final @org.jetbrains.annotations.NotNull method toArray$test_module(@org.jetbrains.annotations.NotNull p0: java.lang.Object[]): java.lang.Object[]
public final @org.jetbrains.annotations.NotNull method toArray$main(@org.jetbrains.annotations.NotNull p0: java.lang.Object[]): java.lang.Object[]
public method toArray(): java.lang.Object[]
}
@@ -15,7 +15,7 @@ public final class InternalGenericToArray {
public method removeAll(p0: java.util.Collection): boolean
public method retainAll(p0: java.util.Collection): boolean
public bridge final method size(): int
public final @org.jetbrains.annotations.NotNull method toArray$test_module(@org.jetbrains.annotations.NotNull p0: java.lang.Object[]): java.lang.Object[]
public final @org.jetbrains.annotations.NotNull method toArray$main(@org.jetbrains.annotations.NotNull p0: java.lang.Object[]): java.lang.Object[]
public method toArray(): java.lang.Object[]
public final method toArray(p0: java.lang.Object[]): java.lang.Object[]
}
@@ -2,8 +2,8 @@
public abstract class A {
// source: 'suspendImpl.kt'
public method <init>(): void
synthetic static method internal$test_module$suspendImpl(p0: A, p1: java.lang.Object): java.lang.Object
public @org.jetbrains.annotations.Nullable method internal$test_module(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
synthetic static method internal$main$suspendImpl(p0: A, p1: java.lang.Object): java.lang.Object
public @org.jetbrains.annotations.Nullable method internal$main(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
synthetic static method protected$suspendImpl(p0: A, p1: java.lang.Object): java.lang.Object
protected @org.jetbrains.annotations.Nullable method protected(@org.jetbrains.annotations.Nullable p0: java.lang.Object): java.lang.Object
synthetic static method public$suspendImpl(p0: A, p1: java.lang.Object): java.lang.Object
@@ -2,8 +2,8 @@
public abstract class A {
// source: 'suspendImpl.kt'
public method <init>(): void
public @org.jetbrains.annotations.Nullable method internal$main(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
synthetic static method internal$suspendImpl(p0: A, p1: kotlin.coroutines.Continuation): java.lang.Object
public @org.jetbrains.annotations.Nullable method internal$test_module(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
synthetic static method protected$suspendImpl(p0: A, p1: kotlin.coroutines.Continuation): java.lang.Object
protected @org.jetbrains.annotations.Nullable method protected(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
synthetic static method public$suspendImpl(p0: A, p1: kotlin.coroutines.Continuation): java.lang.Object
@@ -4,8 +4,8 @@ public final class test/A {
public method <init>(): void
public method <init>(p0: int): void
public synthetic method <init>(p0: int, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void
public synthetic static method internalFunction$test_module$default(p0: test.A, p1: java.lang.String, p2: int, p3: java.lang.Object): void
public final method internalFunction$test_module(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
public synthetic static method internalFunction$main$default(p0: test.A, p1: java.lang.String, p2: int, p3: java.lang.Object): void
public final method internalFunction$main(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
public synthetic static method internalJvmNameFunction$default(p0: test.A, p1: java.lang.String, p2: int, p3: java.lang.Object): void
public final @kotlin.jvm.JvmName method internalJvmNameFunction(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
public synthetic static method publicFunction$default(p0: test.A, p1: java.lang.String, p2: int, p3: java.lang.Object): void
@@ -1,5 +1,5 @@
// FILE: delegationToJavaInterfaceWithWildcardType.kt
// WITH_SIGNATURES
// FILE: delegationToJavaInterfaceWithWildcardType.kt
interface K {
fun kf1(): Collection<out CharSequence>
fun kf2(): Collection<CharSequence>
@@ -2,7 +2,7 @@
public final class Foo {
// source: 'inlineReifiedPropertyVisibility.kt'
public method <init>(): void
public synthetic final method getInternalExtProp$test_module(p0: java.lang.Object): java.lang.String
public synthetic final method getInternalExtProp$main(p0: java.lang.Object): java.lang.String
private synthetic final method getPrivateExtProp(p0: java.lang.Object): java.lang.String
protected synthetic final method getProtectedExtProp(p0: java.lang.Object): java.lang.String
}
@@ -2,7 +2,7 @@
public final class Foo {
// source: 'inlineReifiedVisibility.kt'
public method <init>(): void
public synthetic final method f$test_module(): void
public synthetic final method f$main(): void
protected synthetic final method g(): void
private synthetic final method h(): void
}
@@ -2,7 +2,7 @@
public final class A {
// source: 'suspendInlineReified.kt'
public method <init>(): void
public synthetic final method internalFun$test_module(p0: java.lang.Object): java.lang.Object
public synthetic final method internalFun$main(p0: java.lang.Object): java.lang.Object
private synthetic final method privateFun(p0: java.lang.Object): java.lang.Object
protected synthetic final method protectedFun(p0: java.lang.Object): java.lang.Object
public synthetic final method publicFun(p0: java.lang.Object): java.lang.Object
@@ -2,7 +2,7 @@
public final class A {
// source: 'suspendInlineReified.kt'
public method <init>(): void
public synthetic final method internalFun$test_module(p0: kotlin.coroutines.Continuation): java.lang.Object
public synthetic final method internalFun$main(p0: kotlin.coroutines.Continuation): java.lang.Object
private synthetic final method privateFun(p0: kotlin.coroutines.Continuation): java.lang.Object
protected synthetic final method protectedFun(p0: kotlin.coroutines.Continuation): java.lang.Object
public synthetic final method publicFun(p0: kotlin.coroutines.Continuation): java.lang.Object
@@ -17,8 +17,8 @@ public final class AnnotatedPropertyWithInlineClassTypeInSignatureKt {
public final class C {
// source: 'annotatedPropertyWithInlineClassTypeInSignature.kt'
public method <init>(): void
public synthetic deprecated static @Anno method getInternal-IQRRRT4$test_module$annotations(p0: int): void
public final method getInternal-IQRRRT4$test_module(p0: int): int
public synthetic deprecated static @Anno method getInternal-IQRRRT4$main$annotations(p0: int): void
public final method getInternal-IQRRRT4$main(p0: int): int
public synthetic deprecated static @Anno method getMemberExtension-IQRRRT4$annotations(p0: int): void
public final method getMemberExtension-IQRRRT4(p0: int): int
public synthetic deprecated static @Anno method getReturnType-a_XrcN0$annotations(): void
@@ -12,12 +12,12 @@ public final class Z {
public method equals(p0: java.lang.Object): boolean
public static method equals-impl(p0: int, p1: java.lang.Object): boolean
public final static method equals-impl0(p0: int, p1: int): boolean
public final static method getInternalExtensionVal-impl$test_module(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String): int
public synthetic deprecated static method getInternalExtensionVar$test_module$annotations(p0: java.lang.String): void
public final static method getInternalExtensionVar-impl$test_module(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String): int
public final static method getInternalVal-impl$test_module(p0: int): int
public synthetic deprecated static method getInternalVar$test_module$annotations(): void
public final static method getInternalVar-impl$test_module(p0: int): int
public final static method getInternalExtensionVal-impl$main(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String): int
public synthetic deprecated static method getInternalExtensionVar$main$annotations(p0: java.lang.String): void
public final static method getInternalExtensionVar-impl$main(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String): int
public final static method getInternalVal-impl$main(p0: int): int
public synthetic deprecated static method getInternalVar$main$annotations(): void
public final static method getInternalVar-impl$main(p0: int): int
private final static method getPrivateExtensionVal-impl(p0: int, p1: java.lang.String): int
private synthetic deprecated static method getPrivateExtensionVar$annotations(p0: java.lang.String): void
private final static method getPrivateExtensionVar-impl(p0: int, p1: java.lang.String): int
@@ -33,14 +33,14 @@ public final class Z {
public final method getX(): int
public method hashCode(): int
public static method hashCode-impl(p0: int): int
public final static method internalExtensionFun-impl$test_module(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String): void
public final static method internalFun-impl$test_module(p0: int): void
public final static method internalExtensionFun-impl$main(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String): void
public final static method internalFun-impl$main(p0: int): void
private final static method privateExtensionFun-impl(p0: int, p1: java.lang.String): void
private final static method privateFun-impl(p0: int): void
public final static method publicExtensionFun-impl(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String): void
public final static method publicFun-impl(p0: int): void
public final static method setInternalExtensionVar-impl$test_module(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String, p2: int): void
public final static method setInternalVar-impl$test_module(p0: int, p1: int): void
public final static method setInternalExtensionVar-impl$main(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String, p2: int): void
public final static method setInternalVar-impl$main(p0: int, p1: int): void
private final static method setPrivateExtensionVar-impl(p0: int, p1: java.lang.String, p2: int): void
private final static method setPrivateVar-impl(p0: int, p1: int): void
public final static method setPublicExtensionVar-impl(p0: int, @org.jetbrains.annotations.NotNull p1: java.lang.String, p2: int): void
@@ -3,7 +3,7 @@
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
// WITH_RUNTIME
// JDK_15
// JDK_KIND: FULL_JDK_15
// D8 does not yet desugar java records.
// IGNORE_DEXING
+1 -1
View File
@@ -1,5 +1,5 @@
// FILE: kt43217.kt
// JVM_TARGET: 1.8
// FILE: kt43217.kt
class A {
private val b =
object : DoubleExpression() {
@@ -5,7 +5,7 @@ public class Test {
private @org.jetbrains.annotations.NotNull field protectedProperty: java.lang.String
private @org.jetbrains.annotations.NotNull field publicProperty: java.lang.String
public method <init>(): void
public final @org.jetbrains.annotations.NotNull method getInternalProperty$test_module(): java.lang.String
public final @org.jetbrains.annotations.NotNull method getInternalProperty$main(): java.lang.String
protected final @org.jetbrains.annotations.NotNull method getProtectedProperty(): java.lang.String
public final @org.jetbrains.annotations.NotNull method getPublicProperty(): java.lang.String
public final method update(p0: int): void
@@ -1,5 +1,5 @@
// FILE: rawTypeInSignature.kt
// WITH_SIGNATURES
// FILE: rawTypeInSignature.kt
class GenericInv<T : Number>
class GenericIn<in T : Number>
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.test.backend.handlers
import org.jetbrains.kotlin.codegen.BytecodeListingTextCollectingVisitor
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.CHECK_BYTECODE_LISTING
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_ANNOTATIONS
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.WITH_SIGNATURES
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
import org.jetbrains.kotlin.test.model.BinaryArtifacts
@@ -16,7 +17,9 @@ import org.jetbrains.kotlin.test.services.TestServices
import org.jetbrains.kotlin.test.services.defaultsProvider
import org.jetbrains.kotlin.test.services.moduleStructure
import org.jetbrains.kotlin.test.utils.MultiModuleInfoDumperImpl
import org.jetbrains.kotlin.test.utils.withExtension
import org.jetbrains.kotlin.test.utils.withSuffixAndExtension
import java.io.File
class BytecodeListingHandler(testServices: TestServices) : JvmBinaryArtifactHandler(testServices) {
override val directivesContainers: List<DirectivesContainer>
@@ -29,16 +32,28 @@ class BytecodeListingHandler(testServices: TestServices) : JvmBinaryArtifactHand
val dump = BytecodeListingTextCollectingVisitor.getText(
info.classFileFactory,
BytecodeListingTextCollectingVisitor.Filter.ForCodegenTests,
withSignatures = WITH_SIGNATURES in module.directives
withSignatures = WITH_SIGNATURES in module.directives,
withAnnotations = IGNORE_ANNOTATIONS !in module.directives,
)
multiModuleInfoDumper.builderForModule(module).append(dump)
}
override fun processAfterAllModules(someAssertionWasFailed: Boolean) {
if (multiModuleInfoDumper.isEmpty()) return
val suffix = if (testServices.defaultsProvider.defaultTargetBackend?.isIR == true) "_ir" else ""
val file = testServices.moduleStructure.originalTestDataFiles.first()
.withSuffixAndExtension(suffix, ".txt")
assertions.assertEqualsToFile(file, multiModuleInfoDumper.generateResultingDump())
val sourceFile = testServices.moduleStructure.originalTestDataFiles.first()
val defaultTxtFile = sourceFile.withExtension(".txt")
val isIr = testServices.defaultsProvider.defaultTargetBackend?.isIR == true
val txtFile =
if (isIr) sourceFile.withSuffixAndExtension("_ir", ".txt").takeIf(File::exists) ?: defaultTxtFile
else defaultTxtFile
assertions.assertEqualsToFile(txtFile, multiModuleInfoDumper.generateResultingDump())
if (isIr && txtFile != defaultTxtFile) {
if (txtFile.readText() == defaultTxtFile.readText()) assertions.fail {
"JVM and JVM_IR golden files are identical. Remove $txtFile."
}
}
}
}
@@ -58,7 +58,12 @@ object CodegenTestDirectives : SimpleDirectivesContainer() {
)
val WITH_SIGNATURES by directive(
description = "Include generic signatures in generated classes dump",
description = "Include generic signatures in generated bytecode listing",
applicability = Global
)
val IGNORE_ANNOTATIONS by directive(
description = "Do not render annotations in generated bytecode listing",
applicability = Global
)
@@ -0,0 +1,63 @@
/*
* 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.codegen
import org.jetbrains.kotlin.test.Constructor
import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor
import org.jetbrains.kotlin.test.backend.classic.ClassicJvmBackendFacade
import org.jetbrains.kotlin.test.backend.handlers.BytecodeListingHandler
import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest
import org.jetbrains.kotlin.test.frontend.classic.*
import org.jetbrains.kotlin.test.model.*
abstract class AbstractBytecodeListingTestBase<R : ResultingArtifact.FrontendOutput<R>>(
targetBackend: TargetBackend,
val targetFrontend: FrontendKind<*>
) : AbstractKotlinCompilerWithTargetBackendTest(targetBackend) {
abstract val frontendFacade: Constructor<FrontendFacade<R>>
abstract val frontendToBackendConverter: Constructor<Frontend2BackendConverter<R, *>>
abstract val backendFacade: Constructor<BackendFacade<*, BinaryArtifacts.Jvm>>
override fun TestConfigurationBuilder.configuration() {
commonConfigurationForCodegenTest(targetFrontend, frontendFacade, frontendToBackendConverter, backendFacade)
commonHandlersForCodegenTest()
defaultDirectives {
+CodegenTestDirectives.CHECK_BYTECODE_LISTING
}
useArtifactsHandlers(::BytecodeListingHandler)
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor)
}
}
open class AbstractBytecodeListingTest : AbstractBytecodeListingTestBase<ClassicFrontendOutputArtifact>(
TargetBackend.JVM, FrontendKinds.ClassicFrontend
) {
override val frontendFacade: Constructor<FrontendFacade<ClassicFrontendOutputArtifact>>
get() = ::ClassicFrontendFacade
override val frontendToBackendConverter: Constructor<Frontend2BackendConverter<ClassicFrontendOutputArtifact, *>>
get() = ::ClassicFrontend2ClassicBackendConverter
override val backendFacade: Constructor<BackendFacade<*, BinaryArtifacts.Jvm>>
get() = ::ClassicJvmBackendFacade
}
open class AbstractIrBytecodeListingTest : AbstractBytecodeListingTestBase<ClassicFrontendOutputArtifact>(
TargetBackend.JVM_IR, FrontendKinds.ClassicFrontend
) {
override val frontendFacade: Constructor<FrontendFacade<ClassicFrontendOutputArtifact>>
get() = ::ClassicFrontendFacade
override val frontendToBackendConverter: Constructor<Frontend2BackendConverter<ClassicFrontendOutputArtifact, *>>
get() = ::ClassicFrontend2IrConverter
override val backendFacade: Constructor<BackendFacade<*, BinaryArtifacts.Jvm>>
get() = ::JvmIrBackendFacade
}
@@ -31,4 +31,3 @@ abstract class AbstractJvmBlackBoxCodegenTestBase<R : ResultingArtifact.Frontend
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor)
}
}
@@ -5,11 +5,13 @@
package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.ObsoleteTestInfrastructure
import org.jetbrains.kotlin.test.KotlinTestUtils
import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
import org.jetbrains.kotlin.utils.sure
import java.io.File
@ObsoleteTestInfrastructure(replacer = "org.jetbrains.kotlin.test.runners.codegen.AbstractBytecodeListingTest")
abstract class AbstractBytecodeListingTest : CodegenTestCase() {
override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
compile(files)
@@ -1,13 +0,0 @@
/*
* Copyright 2010-2020 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.codegen.ir
import org.jetbrains.kotlin.codegen.AbstractBytecodeListingTest
import org.jetbrains.kotlin.test.TargetBackend
abstract class AbstractIrBytecodeListingTest : AbstractBytecodeListingTest() {
override val backend = TargetBackend.JVM_IR
}
@@ -9,7 +9,7 @@ import org.jetbrains.kotlin.asJava.AbstractCompilerLightClassTest
import org.jetbrains.kotlin.cfg.AbstractControlFlowTest
import org.jetbrains.kotlin.cfg.AbstractDataFlowTest
import org.jetbrains.kotlin.cfg.AbstractPseudoValueTest
import org.jetbrains.kotlin.checkers.*
import org.jetbrains.kotlin.checkers.AbstractDiagnosticsTestWithJsStdLibAndBackendCompilation
import org.jetbrains.kotlin.cli.AbstractCliTest
import org.jetbrains.kotlin.codegen.*
import org.jetbrains.kotlin.codegen.debugInformation.AbstractIrLocalVariableTest
@@ -19,7 +19,8 @@ import org.jetbrains.kotlin.codegen.debugInformation.AbstractSteppingTest
import org.jetbrains.kotlin.codegen.defaultConstructor.AbstractDefaultArgumentsReflectionTest
import org.jetbrains.kotlin.codegen.flags.AbstractWriteFlagsTest
import org.jetbrains.kotlin.codegen.ir.*
import org.jetbrains.kotlin.fir.*
import org.jetbrains.kotlin.fir.AbstractFirLoadCompiledKotlin
import org.jetbrains.kotlin.fir.AbstractLazyBodyIsNotTouchedTilContractsPhaseTest
import org.jetbrains.kotlin.fir.builder.AbstractPartialRawFirBuilderTestCase
import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderLazyBodiesTestCase
import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderSourceElementMappingTestCase
@@ -146,10 +147,6 @@ fun generateJUnit3CompilerTests(args: Array<String>) {
model("ir/sourceRanges")
}
testClass<AbstractBytecodeListingTest> {
model("codegen/bytecodeListing", targetBackend = TargetBackend.JVM)
}
testClass<AbstractTopLevelMembersInvocationTest> {
model("codegen/topLevelMemberInvocation", extension = null, recursive = false)
}
@@ -389,10 +386,6 @@ fun generateJUnit3CompilerTests(args: Array<String>) {
)
}
testClass<AbstractIrBytecodeListingTest> {
model("codegen/bytecodeListing", targetBackend = TargetBackend.JVM_IR)
}
testClass<AbstractIrCheckLocalVariablesTableTest> {
model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM_IR)
}
@@ -113,6 +113,14 @@ fun generateJUnit5CompilerTests(args: Array<String>) {
testClass<AbstractJvmOldAgainstIrBoxInlineTest> {
model("codegen/boxInline")
}
testClass<AbstractBytecodeListingTest> {
model("codegen/bytecodeListing")
}
testClass<AbstractIrBytecodeListingTest> {
model("codegen/bytecodeListing")
}
}
// ---------------------------------------------- FIR tests ----------------------------------------------
@@ -16,11 +16,13 @@
package org.jetbrains.kotlin.allopen
import org.jetbrains.kotlin.ObsoleteTestInfrastructure
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.codegen.AbstractBytecodeListingTest
import org.jetbrains.kotlin.extensions.DeclarationAttributeAltererExtension
import org.jetbrains.kotlin.test.TargetBackend
@OptIn(ObsoleteTestInfrastructure::class)
abstract class AbstractBytecodeListingTestForAllOpen : AbstractBytecodeListingTest() {
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
val annotations = AbstractAllOpenDeclarationAttributeAltererExtension.ANNOTATIONS_FOR_TESTS +
@@ -28,6 +28,7 @@ abstract class AbstractBlackBoxCodegenTestForNoArg : AbstractBlackBoxCodegenTest
}
}
@OptIn(ObsoleteTestInfrastructure::class)
abstract class AbstractBytecodeListingTestForNoArg : AbstractBytecodeListingTest() {
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
NoArgComponentRegistrar.registerNoArgComponents(environment.project, NOARG_ANNOTATIONS, backend.isIR, false)