Include all jvm stdlib tests into kotlin-stdlib project test
JVM stdlib tests are compiled against JDK 8 so there's no need to divide them by modules anymore #KT-51907
This commit is contained in:
committed by
Space Team
parent
72ced53833
commit
8b68234528
@@ -15,12 +15,6 @@ sourceSets {
|
||||
}
|
||||
test {
|
||||
kotlin {
|
||||
srcDir 'test'
|
||||
if(!BuildPropertiesKt.getKotlinBuildProperties(project).inIdeaSync) {
|
||||
srcDir '../jvm/test'
|
||||
srcDir '../common/test'
|
||||
srcDir '../test'
|
||||
}
|
||||
}
|
||||
}
|
||||
noJdk7Test {
|
||||
@@ -94,20 +88,6 @@ configureFrontendIr(project)
|
||||
|
||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk7')
|
||||
|
||||
task testJdk6Tests(type: Test) {
|
||||
dependsOn(':kotlin-stdlib:testClasses')
|
||||
group = "verification"
|
||||
def kotlinStdLibTestOutput = project(':kotlin-stdlib').sourceSets.test.output
|
||||
def objectFactory = project.objects
|
||||
doFirst {
|
||||
testClassesDirs = kotlinStdLibTestOutput
|
||||
classpath = objectFactory.fileCollection().from(
|
||||
testClassesDirs,
|
||||
sourceSets.test.compileClasspath
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
task testNoJdk7(type: Test, dependsOn: noJdk7TestClasses) {
|
||||
group = "verification"
|
||||
|
||||
@@ -115,5 +95,5 @@ task testNoJdk7(type: Test, dependsOn: noJdk7TestClasses) {
|
||||
classpath = sourceSets.noJdk7Test.runtimeClasspath
|
||||
}
|
||||
|
||||
check.dependsOn testJdk6Tests, testNoJdk7
|
||||
check.dependsOn testNoJdk7
|
||||
|
||||
|
||||
@@ -19,13 +19,6 @@ sourceSets {
|
||||
}
|
||||
test {
|
||||
kotlin {
|
||||
srcDir 'test'
|
||||
if(!BuildPropertiesKt.getKotlinBuildProperties(project).inIdeaSync) {
|
||||
srcDir '../jvm/test'
|
||||
srcDir '../common/test'
|
||||
srcDir '../test'
|
||||
srcDir '../jdk7/test'
|
||||
}
|
||||
}
|
||||
}
|
||||
java9 {
|
||||
@@ -89,28 +82,6 @@ configureFrontendIr(project)
|
||||
|
||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk8')
|
||||
|
||||
task testJdk6Tests(type: Test) { thisTask ->
|
||||
dependsOn(':kotlin-stdlib:testClasses')
|
||||
check.dependsOn(thisTask)
|
||||
group = "verification"
|
||||
def kotlinStdLibTestOutput = project(':kotlin-stdlib').sourceSets.test.output
|
||||
def objectFactory = project.objects
|
||||
doFirst {
|
||||
testClassesDirs = kotlinStdLibTestOutput
|
||||
classpath = objectFactory.fileCollection().from(
|
||||
testClassesDirs,
|
||||
sourceSets.test.compileClasspath
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
[JdkMajorVersion.JDK_9_0, JdkMajorVersion.JDK_10_0, JdkMajorVersion.JDK_11_0].forEach { jvmVersion ->
|
||||
check.dependsOn(tasks.register("jdk${jvmVersion.majorVersion}Test", Test) { thisTask ->
|
||||
group = "verification"
|
||||
thisTask.javaLauncher.set(JvmToolchain.getToolchainLauncherFor(project, jvmVersion))
|
||||
})
|
||||
}
|
||||
|
||||
tasks.named("compileModuleTestJava", JavaCompile) {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_9
|
||||
targetCompatibility = JavaVersion.VERSION_1_9
|
||||
|
||||
@@ -35,6 +35,8 @@ sourceSets {
|
||||
test {
|
||||
kotlin {
|
||||
srcDir 'test'
|
||||
srcDir '../jdk7/test'
|
||||
srcDir '../jdk8/test'
|
||||
}
|
||||
}
|
||||
longRunningTest {
|
||||
@@ -77,6 +79,10 @@ dependencies {
|
||||
mainJdk8Api sourceSets.mainJdk7.output
|
||||
|
||||
testApi project(':kotlin-test:kotlin-test-junit')
|
||||
if (BuildPropertiesKt.getKotlinBuildProperties(project).inIdeaSync) {
|
||||
testCompileOnly sourceSets.mainJdk7.output
|
||||
testCompileOnly sourceSets.mainJdk8.output
|
||||
}
|
||||
|
||||
builtins project(':core:builtins')
|
||||
}
|
||||
@@ -176,8 +182,10 @@ compileTestKotlin {
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-opt-in=kotlin.ExperimentalStdlibApi",
|
||||
"-opt-in=kotlin.io.path.ExperimentalPathApi",
|
||||
"-opt-in=kotlin.io.encoding.ExperimentalEncodingApi",
|
||||
"-XXLanguage:+RangeUntilOperator",
|
||||
"-Xallow-kotlin-package", // TODO: maybe rename test packages
|
||||
]
|
||||
// This is needed for JavaTypeTest; typeOf for non-reified type parameters doesn't work otherwise, for implementation reasons.
|
||||
def args = new ArrayList(freeCompilerArgs)
|
||||
@@ -186,8 +194,11 @@ compileTestKotlin {
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
systemProperty("supportsNamedCapturingGroup", false)
|
||||
[JdkMajorVersion.JDK_9_0, JdkMajorVersion.JDK_10_0, JdkMajorVersion.JDK_11_0].forEach { jvmVersion ->
|
||||
check.dependsOn(tasks.register("jdk${jvmVersion.majorVersion}Test", Test) { thisTask ->
|
||||
group = "verification"
|
||||
thisTask.javaLauncher.set(JvmToolchain.getToolchainLauncherFor(project, jvmVersion))
|
||||
})
|
||||
}
|
||||
|
||||
compileLongRunningTestKotlin {
|
||||
|
||||
Reference in New Issue
Block a user