diff --git a/build.gradle.kts b/build.gradle.kts index 025e7beff95..b1e7fe6746d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -610,6 +610,7 @@ tasks { dependsOn("nativeCompilerTest") dependsOn("firCompilerTest") + dependsOn(":compiler:daemon:daemon-tests:test") dependsOn("scriptingTest") dependsOn(":kotlin-build-common:test") dependsOn(":compiler:incremental-compilation-impl:test") diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 51800855da7..ba115e786e8 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -30,8 +30,6 @@ fun configureFreeCompilerArg(isEnabled: Boolean, compilerArgument: String) { val antLauncherJar by configurations.creating -val ktorExcludesForDaemon : List> by rootProject.extra - dependencies { testRuntime(intellijDep()) // Should come before compiler, because of "progarded" stuff needed for tests @@ -40,7 +38,6 @@ dependencies { testCompile(kotlinStdlib()) - testCompile(project(":kotlin-daemon")) testCompile(commonDep("junit:junit")) testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) testCompileOnly(project(":kotlin-test:kotlin-test-junit")) @@ -55,14 +52,7 @@ dependencies { testCompile(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward testCompile(project(":kotlin-scripting-compiler")) testCompile(project(":kotlin-script-util")) - testCompileOnly(projectRuntimeJar(":kotlin-daemon-client-new")) testCompileOnly(project(":kotlin-reflect-api")) - testCompile(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } - testCompile(commonDep("io.ktor", "ktor-network")) { - ktorExcludesForDaemon.forEach { (group, module) -> - exclude(group = group, module = module) - } - } otherCompilerModules.forEach { testCompileOnly(project(it)) } @@ -77,18 +67,6 @@ dependencies { } testRuntime(project(":kotlin-reflect")) - testRuntime(project(":kotlin-daemon-client-new")) - testRuntime(project(":kotlin-daemon")) // + - testRuntime(project(":daemon-common-new")) // + - testRuntime(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { - isTransitive = false - } - testRuntime(commonDep("io.ktor", "ktor-network")) { - ktorExcludesForDaemon.forEach { (group, module) -> - exclude(group = group, module = module) - } - - } testRuntime(androidDxJar()) testRuntime(toolsJar()) @@ -114,7 +92,6 @@ projectTest(parallel = true) { } } - val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateCompilerTestsKt") testsJar() diff --git a/compiler/daemon/build.gradle.kts b/compiler/daemon/build.gradle.kts index 292dd0a0bd0..55cf56e1958 100644 --- a/compiler/daemon/build.gradle.kts +++ b/compiler/daemon/build.gradle.kts @@ -1,6 +1,6 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -description = "Kotlin Daemon New" +description = "Kotlin Daemon" plugins { kotlin("jvm") diff --git a/compiler/daemon/daemon-tests/build.gradle.kts b/compiler/daemon/daemon-tests/build.gradle.kts new file mode 100644 index 00000000000..d95fcd25dcb --- /dev/null +++ b/compiler/daemon/daemon-tests/build.gradle.kts @@ -0,0 +1,40 @@ + +description = "Kotlin Daemon Tests" + +plugins { + kotlin("jvm") + id("jps-compatible") +} + +val ktorExcludesForDaemon: List> by rootProject.extra + +dependencies { + testCompile(project(":kotlin-test:kotlin-test-jvm")) + testCompile(kotlinStdlib()) + testCompile(commonDep("junit:junit")) + testCompileOnly(project(":kotlin-test:kotlin-test-jvm")) + testCompileOnly(project(":kotlin-test:kotlin-test-junit")) + testCompile(projectRuntimeJar(":kotlin-daemon-client")) + testCompile(projectRuntimeJar(":kotlin-daemon-client-new")) + testCompileOnly(project(":kotlin-daemon")) + testCompile(projectTests(":compiler:tests-common")) + testCompile(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false } + testCompile(commonDep("io.ktor", "ktor-network")) { + ktorExcludesForDaemon.forEach { (group, module) -> + exclude(group = group, module = module) + } + } + testRuntime(project(":kotlin-daemon")) + testRuntime(intellijCoreDep()) { includeJars("intellij-core") } +} + +sourceSets { + "main" {} + "test" { projectDefault() } +} + +projectTest(parallel = true) { + dependsOn(":dist") + workingDir = rootDir + systemProperty("kotlin.test.script.classpath", testSourceSet.output.classesDirs.joinToString(File.pathSeparator)) +} diff --git a/compiler/tests/org/jetbrains/kotlin/daemon/CompilerApiTest.kt b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/CompilerApiTest.kt similarity index 98% rename from compiler/tests/org/jetbrains/kotlin/daemon/CompilerApiTest.kt rename to compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/CompilerApiTest.kt index 55360b76307..773158980a5 100644 --- a/compiler/tests/org/jetbrains/kotlin/daemon/CompilerApiTest.kt +++ b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/CompilerApiTest.kt @@ -105,7 +105,9 @@ class CompilerApiTest : KotlinIntegrationTestBase() { val jar = tmpdir.absolutePath + File.separator + "hello.jar" val (code, outputs) = compileLocally(messageCollector, "-include-runtime", File(getHelloAppBaseDir(), "hello.kt").absolutePath, "-d", jar, "-Xreport-output-files") - Assert.assertEquals(0, code) + if (code != 0) { + Assert.fail("Result code: $code\n${messageCollector.messages.joinToString("\n")}") + } Assert.assertTrue(outputs.isNotEmpty()) Assert.assertEquals(jar, outputs.first().outputFile?.absolutePath) run(getHelloAppBaseDir(), "hello.run", "-cp", jar, "Hello.HelloKt") diff --git a/compiler/tests/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt similarity index 100% rename from compiler/tests/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt rename to compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt diff --git a/compiler/tests/org/jetbrains/kotlin/daemon/experimental/integration/CompilerApiTest.kt b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/integration/CompilerApiTest.kt similarity index 100% rename from compiler/tests/org/jetbrains/kotlin/daemon/experimental/integration/CompilerApiTest.kt rename to compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/integration/CompilerApiTest.kt diff --git a/compiler/tests/org/jetbrains/kotlin/daemon/experimental/integration/CompilerDaemonTest.kt b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/integration/CompilerDaemonTest.kt similarity index 100% rename from compiler/tests/org/jetbrains/kotlin/daemon/experimental/integration/CompilerDaemonTest.kt rename to compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/integration/CompilerDaemonTest.kt diff --git a/compiler/tests/org/jetbrains/kotlin/daemon/experimental/unit/ClientSerializationTest.kt b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/unit/ClientSerializationTest.kt similarity index 100% rename from compiler/tests/org/jetbrains/kotlin/daemon/experimental/unit/ClientSerializationTest.kt rename to compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/unit/ClientSerializationTest.kt diff --git a/compiler/tests/org/jetbrains/kotlin/daemon/experimental/unit/ConnectionsTest.kt b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/unit/ConnectionsTest.kt similarity index 100% rename from compiler/tests/org/jetbrains/kotlin/daemon/experimental/unit/ConnectionsTest.kt rename to compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/unit/ConnectionsTest.kt diff --git a/settings.gradle b/settings.gradle index f4fbeb92f18..c838f882c4a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -123,6 +123,7 @@ include ":kotlin-build-common", ":compiler:tests-common", ":compiler:tests-common-jvm6", ":compiler:tests-against-klib", + ":compiler:daemon:daemon-tests", ":dukat", ":js:js.ast", ":js:js.serializer",