Set thread context classloader in the kotlin runner

#KT-26624 fixed
This commit is contained in:
Ilya Chernikov
2019-08-26 19:43:55 +02:00
parent d3f32c0d8a
commit 08720a3dc6
3 changed files with 31 additions and 0 deletions
@@ -88,6 +88,24 @@ class LauncherScriptTest : TestCaseWithTmpdir() {
)
}
fun testKotlinJvmContextClassLoader() {
val kotlinTestJar = File(PathUtil.kotlinPathsForDistDirectory.homePath, "lib/kotlin-test.jar")
assertTrue("kotlin-main-kts.jar not found, run dist task: ${kotlinTestJar.absolutePath}", kotlinTestJar.exists())
runProcess(
"kotlinc",
"-cp", kotlinTestJar.path,
"$testDataDirectory/contextClassLoaderTester.kt",
"-d", tmpdir.path
)
runProcess(
"kotlin",
"-cp", listOf(tmpdir.path, kotlinTestJar.path).joinToString(File.pathSeparator),
"ContextClassLoaderTester",
expectedStdout = "ok\n"
)
}
fun testKotlincJsSimple() {
runProcess(
"kotlinc-js",