From 5144efc7aeba777b26ea7d9b67a5836bb4d240d4 Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Thu, 7 Jul 2022 17:51:43 +0200 Subject: [PATCH] Do not split multimodule inliner tests into modules --- .../services/SplittingModuleTransformerForBoxTests.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/SplittingModuleTransformerForBoxTests.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/SplittingModuleTransformerForBoxTests.kt index d7f06692385..e979c1c26ab 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/SplittingModuleTransformerForBoxTests.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/SplittingModuleTransformerForBoxTests.kt @@ -21,12 +21,16 @@ import org.jetbrains.kotlin.test.services.impl.TestModuleStructureImpl * Used when the same test sets are run both in a single module mode (as in IrBlackBoxInlineCodegenTest) * and in multi-module mode (as in IrCompileKotlinAgainstInlineKotlinTest). * - * It will fail in case when module structure contains more than one module. + * If the test is already multimodule, do nothing. */ @TestInfrastructureInternals class SplittingModuleTransformerForBoxTests : ModuleStructureTransformer() { override fun transformModuleStructure(moduleStructure: TestModuleStructure): TestModuleStructure { - val module = moduleStructure.modules.singleOrNull() ?: error("Test should contain only one module") + if (moduleStructure.modules.size > 1) { + // The test is already multimodule, no need to split it into modules further. + return moduleStructure + } + val module = moduleStructure.modules.single() val realFiles = module.files.filterNot { it.isAdditional } if (realFiles.size < 2) error("Test should contain at least two files") val additionalFiles = module.files.filter { it.isAdditional }