Add new compiler argument for passing script resolver environment

This commit is contained in:
Ilya Chernikov
2017-03-31 15:38:11 +02:00
parent 234ad39fd6
commit 0199ec18b1
4 changed files with 41 additions and 1 deletions
@@ -92,6 +92,18 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
}
}
fun testScriptResolverEnvironmentArgsParsing() {
fun args(body: K2JVMCompilerArguments.() -> Unit): K2JVMCompilerArguments =
K2JVMCompilerArguments().apply(body)
val messageCollector = TestMessageCollector()
Assert.assertEquals(hashMapOf("abc" to "def", "11" to "ab cd \\ \""),
K2JVMCompiler.createScriptResolverEnvironment(
args { scriptResolverEnvironment = arrayOf("abc=def", """11="ab cd \\ \""""") },
messageCollector))
}
fun testHelloAppLocal() {
val messageCollector = TestMessageCollector()
val jar = tmpdir.absolutePath + File.separator + "hello.jar"