Extract daemon tests to separate module

This commit is contained in:
Ilya Chernikov
2020-04-20 12:23:16 +02:00
parent 86d47b496b
commit ec64869d39
11 changed files with 46 additions and 25 deletions
+1
View File
@@ -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")
-23
View File
@@ -30,8 +30,6 @@ fun configureFreeCompilerArg(isEnabled: Boolean, compilerArgument: String) {
val antLauncherJar by configurations.creating
val ktorExcludesForDaemon : List<Pair<String, String>> 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()
+1 -1
View File
@@ -1,6 +1,6 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
description = "Kotlin Daemon New"
description = "Kotlin Daemon"
plugins {
kotlin("jvm")
@@ -0,0 +1,40 @@
description = "Kotlin Daemon Tests"
plugins {
kotlin("jvm")
id("jps-compatible")
}
val ktorExcludesForDaemon: List<Pair<String, String>> 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))
}
@@ -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")
+1
View File
@@ -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",