Add test for freeCompilerArgs in kotlin options for Gradle
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
package org.jetbrains.kotlin.gradle.dsl
|
||||
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
|
||||
class KotlinJvmOptionsTest {
|
||||
@Test
|
||||
fun testFreeArguments() {
|
||||
val options = KotlinJvmOptionsImpl()
|
||||
options.freeCompilerArgs = listOf(
|
||||
"-Xreport-perf",
|
||||
"-Xallow-kotlin-package",
|
||||
"-Xmultifile-parts-inherit",
|
||||
"-Xdump-declarations-to", "declarationsPath",
|
||||
"-script-templates", "a,b,c")
|
||||
|
||||
val arguments = K2JVMCompilerArguments()
|
||||
options.updateArguments(arguments)
|
||||
assertEquals("reportPerf", true, arguments.reportPerf)
|
||||
assertEquals("allowKotlinPackage", true, arguments.allowKotlinPackage)
|
||||
assertEquals("inheritMultifileParts", true, arguments.inheritMultifileParts)
|
||||
assertEquals("declarationsOutputPath", "declarationsPath", arguments.declarationsOutputPath)
|
||||
assertArrayEquals("scriptTemplates", arrayOf("a", "b", "c"), arguments.scriptTemplates)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user