Make jdk root processing more robust

#KT-54337 fixed
This commit is contained in:
Ilya Chernikov
2022-10-07 13:06:52 +02:00
committed by Space Team
parent 942def5828
commit b50a803b6f
7 changed files with 46 additions and 12 deletions
@@ -478,4 +478,28 @@ println(42)
"kotlinc", "$testDataDirectory/interpreterClassLoader.kt", "-d", tmpdir.path
)
}
fun testImplicitModularJdk() {
// see KT-54337
val moduleInfo = tmpdir.resolve("module-info.java").apply {
writeText(
"""
module test {
requires kotlin.stdlib;
}
""".trimIndent()
)
}
val testKt = tmpdir.resolve("test.kt").apply {
writeText("fun main() {}")
}
val jdk11 = mapOf("JAVA_HOME" to KtTestUtil.getJdk11Home().absolutePath)
runProcess(
"kotlinc", moduleInfo.absolutePath, testKt.absolutePath, "-d", tmpdir.path,
environment = jdk11,
expectedExitCode = 0,
expectedStdout = "",
expectedStderr = ""
)
}
}