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 0a8e5c90efd..87d79475b0b 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 @@ -173,14 +173,41 @@ abstract class BasicWasmBoxTest( val testJs = if (debugMode >= DebugMode.DEBUG) testJsVerbose else testJsQuiet - fun compileAndRunD8Test(name: String, res: WasmCompilerResult) { + fun writeToFilesAndRunD8Test(name: String, res: WasmCompilerResult) { val dir = File(outputDirBase, name) + dir.mkdirs() + if (debugMode >= DebugMode.DEBUG) { val path = dir.absolutePath - println(" ------ $name WAT file://$path/index.wat") - println(" ------ $name WASM file://$path/index.wasm") + println(" ------ $name Wat file://$path/index.wat") + println(" ------ $name Wasm file://$path/index.wasm") println(" ------ $name JS file://$path/index.mjs") println(" ------ $name Test file://$path/test.mjs") + val projectName = "kotlin" + println(" ------ $name HTML http://0.0.0.0:63342/$projectName/${dir.path}/index.html") + + File(dir, "index.html").writeText( + """ + + + + UNKNOWN + + + + """.trimIndent() + ) } writeCompilationResult(res, dir) @@ -196,36 +223,8 @@ abstract class BasicWasmBoxTest( ) } - compileAndRunD8Test("d8", compilerResult) - compileAndRunD8Test("d8-dce", compilerResultWithDCE) - - if (debugMode >= DebugMode.SUPER_DEBUG) { - fun writeBrowserTest(name: String, res: WasmCompilerResult) { - val dir = File(outputDirBase, name) - writeCompilationResult(res, dir) - File(dir, "test.mjs").writeText(testJsVerbose) - File(dir, "index.html").writeText( - """ - - - - - - - """.trimIndent() - ) - val path = dir.absolutePath - println(" ------ $name WAT file://$path/index.wat") - println(" ------ $name WASM file://$path/index.wasm") - println(" ------ $name JS file://$path/index.mjs") - println(" ------ $name TEST file://$path/test.mjs") - println(" ------ $name HTML file://$path/index.html") - } - - writeBrowserTest("browser", compilerResult) - writeBrowserTest("browser-dce", compilerResultWithDCE) - } - + writeToFilesAndRunD8Test("d8", compilerResult) + writeToFilesAndRunD8Test("d8-dce", compilerResultWithDCE) } }