[JS, Tests] Migrate IR tests onto outputDir and outputName

This commit is contained in:
Ilya Goncharov
2022-07-28 13:51:39 +02:00
committed by teamcity
parent eeb0520b48
commit f320efedd3
6 changed files with 16 additions and 10 deletions
@@ -109,11 +109,10 @@ class IncrementalJsCompilerRunner(
}
override fun destinationDir(args: K2JSCompilerArguments): File {
val outputFile = File(args.outputFile!!)
return if (args.isIrBackendEnabled())
outputFile
File(args.outputDir!!)
else
outputFile.parentFile
File(args.outputFile!!).parentFile
}
override fun calculateSourcesToCompile(
@@ -9,7 +9,9 @@ abstract class AbstractIncrementalJsKlibCompilerRunnerTest : AbstractIncremental
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JSCompilerArguments =
K2JSCompilerArguments().apply {
libraries = "build/js-ir-runtime/full-runtime.klib"
outputFile = File(destinationDir, "${testDir.name}.$KLIB_FILE_EXTENSION").path
outputDir = destinationDir.path
outputName = testDir.name
outputFile = null
sourceMap = false
irProduceKlibDir = false
irProduceKlibFile = true
@@ -19,7 +19,8 @@ abstract class AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest :
override fun createCompilerArguments(destinationDir: File, testDir: File): K2JSCompilerArguments =
K2JSCompilerArguments().apply {
libraries = STDLIB_DEPENDENCY
outputFile = File(destinationDir, "${testDir.name}.$KLIB_FILE_EXTENSION").path
outputDir = destinationDir.path
outputName = testDir.name
sourceMap = false
irProduceKlibDir = false
irProduceKlibFile = true
@@ -81,7 +82,8 @@ abstract class AbstractIncrementalMultiModuleJsKlibCompilerRunnerTest :
}
libraries = sb.toString()
outputFile = outFile.path
outputDir = outFile.parentFile.path
outputName = outFile.nameWithoutExtension
}
companion object {