[JS] Migrate tests onto IR compiler with outputDir API instead of outputFile
^KT-61117 fixed
This commit is contained in:
committed by
Space Team
parent
e50f6e6bca
commit
08e3cb300a
-5
@@ -99,9 +99,6 @@ abstract class AbstractJvmLookupTrackerTest : AbstractLookupTrackerTest() {
|
||||
}
|
||||
|
||||
abstract class AbstractJsKlibLookupTrackerTest : AbstractJsLookupTrackerTest() {
|
||||
override val jsStdlibFile: File
|
||||
get() = File(System.getProperty("jps.testData.js-ir-runtime") ?: "build/js-ir-runtime/full-runtime.klib")
|
||||
|
||||
override fun configureAdditionalArgs(args: K2JSCompilerArguments) {
|
||||
args.irProduceKlibDir = true
|
||||
args.irOnly = true
|
||||
@@ -157,7 +154,6 @@ abstract class AbstractJsLookupTrackerTest : AbstractLookupTrackerTest() {
|
||||
get() = PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibKlibPath
|
||||
|
||||
protected open fun configureAdditionalArgs(args: K2JSCompilerArguments) {
|
||||
args.outputFile = File(outDir, "out.js").canonicalPath
|
||||
}
|
||||
|
||||
override fun runCompiler(filesToCompile: Iterable<File>, env: JpsCompilerEnvironment): Any? {
|
||||
@@ -166,7 +162,6 @@ abstract class AbstractJsLookupTrackerTest : AbstractLookupTrackerTest() {
|
||||
libraries = libPaths.joinToString(File.pathSeparator)
|
||||
reportOutputFiles = true
|
||||
freeArgs = filesToCompile.map { it.canonicalPath }
|
||||
forceDeprecatedLegacyCompilerUsage = true
|
||||
useFirLT = false
|
||||
}
|
||||
configureAdditionalArgs(args)
|
||||
|
||||
+1
-3
@@ -90,9 +90,7 @@ abstract class KotlinJpsBuildTestBase : AbstractKotlinJpsBuildTestCase() {
|
||||
protected fun setupKotlinJSFacet() {
|
||||
myProject.modules.forEach {
|
||||
val facet = KotlinFacetSettings()
|
||||
facet.compilerArguments = K2JSCompilerArguments().apply {
|
||||
forceDeprecatedLegacyCompilerUsage = true
|
||||
}
|
||||
facet.compilerArguments = K2JSCompilerArguments()
|
||||
facet.targetPlatform = JsPlatforms.defaultJsPlatform
|
||||
|
||||
it.container.setChild(
|
||||
|
||||
-1
@@ -264,7 +264,6 @@ class ModulesTxtBuilder {
|
||||
"js" -> settings.compilerArguments =
|
||||
K2JSCompilerArguments().also {
|
||||
settings.targetPlatform = JsPlatforms.defaultJsPlatform
|
||||
it.forceDeprecatedLegacyCompilerUsage = true
|
||||
}
|
||||
"native" -> settings.compilerArguments =
|
||||
K2NativeCompilerArguments().also { settings.targetPlatform = NativePlatforms.unspecifiedNativePlatform }
|
||||
|
||||
+10
-4
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.jps.incremental
|
||||
|
||||
import org.jetbrains.kotlin.cli.common.CompilerSystemProperties
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants
|
||||
import org.jetbrains.kotlin.compilerRunner.OutputItemsCollectorImpl
|
||||
@@ -27,10 +26,15 @@ import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumer
|
||||
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumerImpl
|
||||
import org.jetbrains.kotlin.incremental.utils.TestMessageCollector
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.test.kotlinPathsForDistDirectoryForTests
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import org.junit.Assert
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractJsProtoComparisonTest : AbstractProtoComparisonTest<ProtoData>() {
|
||||
protected open val jsStdlibFile: File
|
||||
get() = PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibKlibPath
|
||||
|
||||
override fun expectedOutputFile(testDir: File): File =
|
||||
File(testDir, "result-js.out")
|
||||
.takeIf { it.exists() }
|
||||
@@ -47,11 +51,13 @@ abstract class AbstractJsProtoComparisonTest : AbstractProtoComparisonTest<Proto
|
||||
val messageCollector = TestMessageCollector()
|
||||
val outputItemsCollector = OutputItemsCollectorImpl()
|
||||
val args = K2JSCompilerArguments().apply {
|
||||
outputFile = File(outputDir, "out.js").canonicalPath
|
||||
metaInfo = true
|
||||
this.outputDir = outputDir.normalize().absolutePath
|
||||
moduleName = "out"
|
||||
libraries = jsStdlibFile.absolutePath
|
||||
irProduceKlibDir = true
|
||||
irOnly = true
|
||||
main = K2JsArgumentConstants.NO_CALL
|
||||
freeArgs = ktFiles
|
||||
forceDeprecatedLegacyCompilerUsage = true
|
||||
languageVersion = "1.9"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user