From 2c34888a571426c93f5cdf69876449a77ae9f1a9 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Tue, 15 Jun 2021 16:23:59 +0300 Subject: [PATCH] [TEST] Add comment in klib text tests runner --- .../jetbrains/kotlin/ir/AbstractKlibTextTestCase.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractKlibTextTestCase.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractKlibTextTestCase.kt index 29e95c17d80..8a48a40a029 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractKlibTextTestCase.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractKlibTextTestCase.kt @@ -56,6 +56,9 @@ import org.jetbrains.kotlin.utils.rethrow import java.io.File import java.util.* +/** + * Compares compiled and deserialized IR + */ abstract class AbstractKlibTextTestCase : CodegenTestCase() { companion object { @@ -83,9 +86,6 @@ abstract class AbstractKlibTextTestCase : CodegenTestCase() { myEnvironment = KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JS_CONFIG_FILES) } - private val CompilerConfiguration.expectActualLinker: Boolean - get() = get(CommonConfigurationKeys.EXPECT_ACTUAL_LINKER) ?: false - fun doTest(wholeFile: File) { val expectActualSymbols = mutableMapOf() val ignoreErrors = AbstractIrGeneratorTestCase.shouldIgnoreErrors(wholeFile) @@ -96,8 +96,7 @@ abstract class AbstractKlibTextTestCase : CodegenTestCase() { myEnvironment.configuration.languageVersionSettings.getFeatureSupport(LanguageFeature.MultiPlatformProjects) == LanguageFeature.State.ENABLED val klibPath = serializeModule(irModule, bindingContext, stdlib, ignoreErrors, expectActualSymbols, !mppProject) val libs = loadKlibFromPath(listOf(runtimeKlibPath, klibPath)) - val stdlib2 = libs[0] - val klib = libs[1] + val (stdlib2, klib) = libs val deserializedIrModule = deserializeModule(stdlib2, klib) val actual = deserializedIrModule.dump(stableOrder = true) @@ -108,7 +107,7 @@ abstract class AbstractKlibTextTestCase : CodegenTestCase() { } } - private fun KlibMetadataIncrementalSerializer(configuration: CompilerConfiguration, project: Project, allowErrors: Boolean) = + private fun klibMetadataIncrementalSerializer(configuration: CompilerConfiguration, project: Project, allowErrors: Boolean) = KlibMetadataIncrementalSerializer( languageVersionSettings = configuration.languageVersionSettings, metadataVersion = KlibMetadataVersion.INSTANCE, @@ -140,7 +139,7 @@ abstract class AbstractKlibTextTestCase : CodegenTestCase() { ) val moduleDescriptor = irModuleFragment.descriptor - val metadataSerializer = KlibMetadataIncrementalSerializer(myEnvironment.configuration, myEnvironment.project, containsErrorCode) + val metadataSerializer = klibMetadataIncrementalSerializer(myEnvironment.configuration, myEnvironment.project, containsErrorCode) val compiledKotlinFiles = mutableListOf()