Remove unused and unnecessary classpath entries in compiler tests

Also remove obsolete additional path arguments for runIde task.
This commit is contained in:
Ilya Gorbunov
2018-08-15 03:13:36 +03:00
parent 237d870618
commit 38d8451d1c
3 changed files with 4 additions and 10 deletions
@@ -141,8 +141,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
"-Dapple.laf.useScreenMenuBar=true", "-Dapple.laf.useScreenMenuBar=true",
"-Dapple.awt.graphics.UseQuartz=true", "-Dapple.awt.graphics.UseQuartz=true",
"-Dsun.io.useCanonCaches=false", "-Dsun.io.useCanonCaches=false",
"-Dplugin.path=${ideaPluginDir.absolutePath}", "-Dplugin.path=${ideaPluginDir.absolutePath}"
"-Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar"
) )
if (rootProject.findProperty("versions.androidStudioRelease") != null) { if (rootProject.findProperty("versions.androidStudioRelease") != null) {
@@ -41,9 +41,6 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
val compilerClassPath = listOf( val compilerClassPath = listOf(
File(compilerLibDir, "kotlin-compiler.jar")) File(compilerLibDir, "kotlin-compiler.jar"))
val scriptRuntimeClassPath = listOf(
File(compilerLibDir, "kotlin-runtime.jar"),
File(compilerLibDir, "kotlin-script-runtime.jar"))
val compilerId by lazy(LazyThreadSafetyMode.NONE) { CompilerId.makeCompilerId(compilerClassPath) } val compilerId by lazy(LazyThreadSafetyMode.NONE) { CompilerId.makeCompilerId(compilerClassPath) }
private fun compileLocally(messageCollector: TestMessageCollector, vararg args: String): Pair<Int, Collection<OutputMessageUtil.Output>> { private fun compileLocally(messageCollector: TestMessageCollector, vararg args: String): Pair<Int, Collection<OutputMessageUtil.Output>> {
@@ -147,7 +144,7 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
Assert.assertEquals(0, code) Assert.assertEquals(0, code)
Assert.assertTrue(outputs.isNotEmpty()) Assert.assertTrue(outputs.isNotEmpty())
Assert.assertEquals(File(tmpdir, "Script.class").absolutePath, outputs.first().outputFile?.absolutePath) Assert.assertEquals(File(tmpdir, "Script.class").absolutePath, outputs.first().outputFile?.absolutePath)
runScriptWithArgs(getSimpleScriptBaseDir(), "script", "Script", scriptRuntimeClassPath + tmpdir, "hi", "there") runScriptWithArgs(getSimpleScriptBaseDir(), "script", "Script", listOf(tmpdir), "hi", "there")
} }
fun testSimpleScript() { fun testSimpleScript() {
@@ -168,7 +165,7 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
Assert.assertEquals(0, code) Assert.assertEquals(0, code)
Assert.assertTrue(outputs.isNotEmpty()) Assert.assertTrue(outputs.isNotEmpty())
Assert.assertEquals(File(tmpdir, "Script.class").absolutePath, outputs.first().outputFile?.absolutePath) Assert.assertEquals(File(tmpdir, "Script.class").absolutePath, outputs.first().outputFile?.absolutePath)
runScriptWithArgs(getSimpleScriptBaseDir(), "script", "Script", scriptRuntimeClassPath + tmpdir, "hi", "there") runScriptWithArgs(getSimpleScriptBaseDir(), "script", "Script", listOf(tmpdir), "hi", "there")
} }
finally { finally {
KotlinCompilerClient.shutdownCompileService(compilerId, daemonOptions) KotlinCompilerClient.shutdownCompileService(compilerId, daemonOptions)
@@ -36,9 +36,7 @@ public abstract class CompilerSmokeTestBase extends KotlinIntegrationTestBase {
javaArgs.add("-cp"); javaArgs.add("-cp");
javaArgs.add(StringsKt.join(Arrays.asList( javaArgs.add(StringsKt.join(Arrays.asList(
getCompilerLib().getAbsolutePath() + File.separator + "kotlin-compiler.jar", getCompilerLib().getAbsolutePath() + File.separator + "kotlin-compiler.jar"
new File("dependencies/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-runtime.jar").getAbsolutePath(),
new File("dependencies/bootstrap-compiler/Kotlin/kotlinc/lib/kotlin-reflect.jar").getAbsolutePath()
), File.pathSeparator)); ), File.pathSeparator));
javaArgs.add("org.jetbrains.kotlin.cli.jvm.K2JVMCompiler"); javaArgs.add("org.jetbrains.kotlin.cli.jvm.K2JVMCompiler");