[JS] Migrate multiplatform integration compiler test
This commit is contained in:
committed by
Space Team
parent
a6d461dbe8
commit
3bdb8b6d11
+16
-2
@@ -27,6 +27,7 @@ import org.jetbrains.kotlin.test.KotlinTestUtils
|
|||||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||||
import org.jetbrains.kotlin.test.util.trimTrailingWhitespacesAndAddNewlineAtEOF
|
import org.jetbrains.kotlin.test.util.trimTrailingWhitespacesAndAddNewlineAtEOF
|
||||||
|
import org.jetbrains.kotlin.utils.PathUtil
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
@@ -49,7 +50,7 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() {
|
|||||||
|
|
||||||
val commonDest = File(tmpdir, "common").absolutePath
|
val commonDest = File(tmpdir, "common").absolutePath
|
||||||
val jvmDest = File(tmpdir, "jvm").absolutePath.takeIf { jvmSrc != null }
|
val jvmDest = File(tmpdir, "jvm").absolutePath.takeIf { jvmSrc != null }
|
||||||
val jsDest = File(File(tmpdir, "js"), "output.js").absolutePath.takeIf { jsSrc != null }
|
val jsDest = File(tmpdir, "js").absolutePath.takeIf { jsSrc != null }
|
||||||
val common2Dest = File(tmpdir, "common2").absolutePath.takeIf { common2Src != null }
|
val common2Dest = File(tmpdir, "common2").absolutePath.takeIf { common2Src != null }
|
||||||
val jvm2Dest = File(tmpdir, "jvm2").absolutePath.takeIf { jvm2Src != null }
|
val jvm2Dest = File(tmpdir, "jvm2").absolutePath.takeIf { jvm2Src != null }
|
||||||
|
|
||||||
@@ -66,7 +67,20 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() {
|
|||||||
if (jsSrc != null) {
|
if (jsSrc != null) {
|
||||||
appendLine()
|
appendLine()
|
||||||
appendLine("-- JS --")
|
appendLine("-- JS --")
|
||||||
appendLine(K2JSCompiler().compile(jsSrc, commonSrc, "-Xforce-deprecated-legacy-compiler-usage", "-output", jsDest!!))
|
appendLine(
|
||||||
|
K2JSCompiler().compile(
|
||||||
|
jsSrc,
|
||||||
|
commonSrc,
|
||||||
|
"-Xir-produce-klib-dir",
|
||||||
|
"-Xir-only",
|
||||||
|
"-libraries",
|
||||||
|
PathUtil.kotlinPathsForCompiler.jsStdLibJarPath.absolutePath,
|
||||||
|
"-ir-output-dir",
|
||||||
|
jsDest!!,
|
||||||
|
"-ir-output-name",
|
||||||
|
"output"
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (common2Src != null) {
|
if (common2Src != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user