From c2d4a2cfb51bde4040a40d6f04293b1a7983e83d Mon Sep 17 00:00:00 2001 From: Igor Yakovlev Date: Tue, 16 Aug 2022 19:32:17 +0200 Subject: [PATCH] [WASM] Small refactoring of box test runner --- .../kotlin/js/testOld/BasicWasmBoxTest.kt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/testOld/BasicWasmBoxTest.kt b/js/js.tests/test/org/jetbrains/kotlin/js/testOld/BasicWasmBoxTest.kt index 7912e87e929..a6877a6ce9a 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/testOld/BasicWasmBoxTest.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/js/testOld/BasicWasmBoxTest.kt @@ -94,22 +94,22 @@ abstract class BasicWasmBoxTest( val filesToCompile = psiFiles.map { TranslationUnit.SourceFile(it).file } val debugMode = DebugMode.fromSystemProperty("kotlin.wasm.debugMode") - val phaseConfig = if (debugMode >= DebugMode.DEBUG) { - val allPhasesSet = if (debugMode >= DebugMode.SUPER_DEBUG) wasmPhases.toPhaseMap().values.toSet() else emptySet() + val phaseConfig = if (debugMode >= DebugMode.SUPER_DEBUG) { val dumpOutputDir = File(outputDirBase, "irdump") println("\n ------ Dumping phases to file://${dumpOutputDir.absolutePath}") - println(" ------ KT file://${file.absolutePath}") PhaseConfig( wasmPhases, dumpToDirectory = dumpOutputDir.path, - toDumpStateAfter = allPhasesSet, - // toValidateStateAfter = allPhasesSet, - // dumpOnlyFqName = null + toDumpStateAfter = wasmPhases.toPhaseMap().values.toSet(), ) } else { PhaseConfig(wasmPhases) } + if (debugMode >= DebugMode.DEBUG) { + println(" ------ KT file://${file.absolutePath}") + } + val sourceModule = prepareAnalyzedSourceModule( config.project, filesToCompile, @@ -301,8 +301,3 @@ abstract class BasicWasmBoxTest( private const val TEST_FUNCTION = "box" } } - -private fun File.write(text: String) { - parentFile.mkdirs() - writeText(text) -}