FIR Tests. Fix jdkHome loading, allow to specify jvmTarget for FP test
This commit is contained in:
+3
-1
@@ -23,6 +23,7 @@ import java.nio.file.Files
|
|||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
|
||||||
private val USE_BUILD_FILE: Boolean = System.getProperty("fir.bench.use.build.file", "true").toBooleanLenient()!!
|
private val USE_BUILD_FILE: Boolean = System.getProperty("fir.bench.use.build.file", "true").toBooleanLenient()!!
|
||||||
|
private val JVM_TARGET: String = System.getProperty("fir.bench.jvm.target", "1.8")
|
||||||
|
|
||||||
abstract class AbstractFullPipelineModularizedTest : AbstractModularizedTest() {
|
abstract class AbstractFullPipelineModularizedTest : AbstractModularizedTest() {
|
||||||
|
|
||||||
@@ -129,7 +130,7 @@ abstract class AbstractFullPipelineModularizedTest : AbstractModularizedTest() {
|
|||||||
|
|
||||||
private fun configureBaseArguments(args: K2JVMCompilerArguments, moduleData: ModuleData, tmp: Path) {
|
private fun configureBaseArguments(args: K2JVMCompilerArguments, moduleData: ModuleData, tmp: Path) {
|
||||||
args.reportPerf = true
|
args.reportPerf = true
|
||||||
args.jvmTarget = "1.8"
|
args.jvmTarget = JVM_TARGET
|
||||||
args.allowKotlinPackage = true
|
args.allowKotlinPackage = true
|
||||||
if (USE_BUILD_FILE) {
|
if (USE_BUILD_FILE) {
|
||||||
configureArgsUsingBuildFile(args, moduleData, tmp)
|
configureArgsUsingBuildFile(args, moduleData, tmp)
|
||||||
@@ -165,6 +166,7 @@ abstract class AbstractFullPipelineModularizedTest : AbstractModularizedTest() {
|
|||||||
val modulesFile = tmp.toFile().resolve("modules.xml")
|
val modulesFile = tmp.toFile().resolve("modules.xml")
|
||||||
modulesFile.writeText(builder.asText().toString())
|
modulesFile.writeText(builder.asText().toString())
|
||||||
args.buildFile = modulesFile.absolutePath
|
args.buildFile = modulesFile.absolutePath
|
||||||
|
args.jdkHome = moduleData.jdkHome?.absolutePath
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract fun configureArguments(args: K2JVMCompilerArguments, moduleData: ModuleData)
|
abstract fun configureArguments(args: K2JVMCompilerArguments, moduleData: ModuleData)
|
||||||
|
|||||||
+4
@@ -32,6 +32,7 @@ data class ModuleData(
|
|||||||
val rawJavaSourceRoots: List<JavaSourceRootData<String>>,
|
val rawJavaSourceRoots: List<JavaSourceRootData<String>>,
|
||||||
val rawFriendDirs: List<String>,
|
val rawFriendDirs: List<String>,
|
||||||
val rawModularJdkRoot: String?,
|
val rawModularJdkRoot: String?,
|
||||||
|
val rawJdkHome: String?,
|
||||||
val isCommon: Boolean
|
val isCommon: Boolean
|
||||||
) {
|
) {
|
||||||
val qualifiedName get() = if (name in qualifier) qualifier else "$name.$qualifier"
|
val qualifiedName get() = if (name in qualifier) qualifier else "$name.$qualifier"
|
||||||
@@ -41,6 +42,7 @@ data class ModuleData(
|
|||||||
val sources = rawSources.map { it.fixPath() }
|
val sources = rawSources.map { it.fixPath() }
|
||||||
val javaSourceRoots = rawJavaSourceRoots.map { JavaSourceRootData(it.path.fixPath(), it.packagePrefix) }
|
val javaSourceRoots = rawJavaSourceRoots.map { JavaSourceRootData(it.path.fixPath(), it.packagePrefix) }
|
||||||
val friendDirs = rawFriendDirs.map { it.fixPath() }
|
val friendDirs = rawFriendDirs.map { it.fixPath() }
|
||||||
|
val jdkHome = rawJdkHome?.fixPath()
|
||||||
val modularJdkRoot = rawModularJdkRoot?.fixPath()
|
val modularJdkRoot = rawModularJdkRoot?.fixPath()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +125,7 @@ abstract class AbstractModularizedTest : KtUsefulTestCase() {
|
|||||||
val sources = mutableListOf<String>()
|
val sources = mutableListOf<String>()
|
||||||
val friendDirs = mutableListOf<String>()
|
val friendDirs = mutableListOf<String>()
|
||||||
val timestamp = moduleElement.attributes.getNamedItem("timestamp")?.nodeValue?.toLong() ?: 0
|
val timestamp = moduleElement.attributes.getNamedItem("timestamp")?.nodeValue?.toLong() ?: 0
|
||||||
|
val jdkHome = moduleElement.attributes.getNamedItem("jdkHome")?.nodeValue
|
||||||
var modularJdkRoot: String? = null
|
var modularJdkRoot: String? = null
|
||||||
var isCommon = false
|
var isCommon = false
|
||||||
|
|
||||||
@@ -163,6 +166,7 @@ abstract class AbstractModularizedTest : KtUsefulTestCase() {
|
|||||||
javaSourceRoots,
|
javaSourceRoots,
|
||||||
friendDirs,
|
friendDirs,
|
||||||
modularJdkRoot,
|
modularJdkRoot,
|
||||||
|
jdkHome,
|
||||||
isCommon
|
isCommon
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user