Extract jvm6-specific test utils, add codegen on specific jdk tests

This commit is contained in:
Ilya Chernikov
2017-09-18 17:59:04 +02:00
parent 82690fe6b3
commit 51efd717f6
14 changed files with 125 additions and 24 deletions
+36
View File
@@ -42,6 +42,7 @@ dependencies {
testCompileOnly(projectDist(":kotlin-test:kotlin-test-jvm"))
testCompileOnly(projectDist(":kotlin-test:kotlin-test-junit"))
testCompile(project(":compiler.tests-common"))
testCompile(project(":compiler:tests-common-jvm6"))
testCompile(project(":compiler:ir.ir2cfg"))
testCompile(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward
otherCompilerModules.forEach {
@@ -79,3 +80,38 @@ projectTest {
systemProperty("kotlin.test.script.classpath", the<JavaPluginConvention>().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
}
evaluationDependsOn(":compiler:tests-common-jvm6")
fun Project.codegenTest(taskName: String, body: Test.() -> Unit): Test = projectTest(taskName) {
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
workingDir = rootDir
environment("TEST_SERVER_CLASSES_DIRS", project(":compiler:tests-common-jvm6").the<JavaPluginConvention>().sourceSets.getByName("main").output.classesDirs.asPath)
filter.includeTestsMatching("org.jetbrains.kotlin.codegen.CodegenJdkCommonTestSuite*")
body()
}
codegenTest("codegen-target6-jvm6-test") {
systemProperty("kotlin.test.default.jvm.target", "1.6")
systemProperty("kotlin.test.java.compilation.target", "1.6")
systemProperty("kotlin.test.box.in.separate.process.port", "5100")
}
codegenTest("codegen-target6-jvm9-test") {
systemProperty("kotlin.test.default.jvm.target", "1.6")
jvmArgs = listOf("--add-opens", "java.desktop/javax.swing=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED")
}
codegenTest("codegen-target8-jvm8-test") {
systemProperty("kotlin.test.default.jvm.target", "1.8")
}
codegenTest("codegen-target8-jvm9-test") {
systemProperty("kotlin.test.default.jvm.target", "1.8")
jvmArgs = listOf("--add-opens", "java.desktop/javax.swing=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED")
}
codegenTest("codegen-target9-jvm9-test") {
systemProperty("kotlin.test.default.jvm.target", "1.8")
systemProperty("kotlin.test.substitute.bytecode.1.8.to.1.9", "true")
jvmArgs = listOf("--add-opens", "java.desktop/javax.swing=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED")
}