GenerateTests.kt: restore Kotlin JPS plugin tests schema
This commit is contained in:
@@ -5,6 +5,15 @@ plugins {
|
|||||||
|
|
||||||
val compilerModules: Array<String> by rootProject.extra
|
val compilerModules: Array<String> by rootProject.extra
|
||||||
|
|
||||||
|
|
||||||
|
val generateTests by generator("org.jetbrains.kotlin.jps.GenerateJpsPluginTestsKt") {
|
||||||
|
javaLauncher.set(
|
||||||
|
javaToolchains.launcherFor {
|
||||||
|
languageVersion.set(JavaLanguageVersion.of(11))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(project(":kotlin-build-common"))
|
compile(project(":kotlin-build-common"))
|
||||||
compile(project(":core:descriptors"))
|
compile(project(":core:descriptors"))
|
||||||
@@ -14,6 +23,7 @@ dependencies {
|
|||||||
compile(project(":daemon-common-new"))
|
compile(project(":daemon-common-new"))
|
||||||
compile(projectRuntimeJar(":kotlin-daemon-client"))
|
compile(projectRuntimeJar(":kotlin-daemon-client"))
|
||||||
compile(projectRuntimeJar(":kotlin-daemon"))
|
compile(projectRuntimeJar(":kotlin-daemon"))
|
||||||
|
testImplementation(projectTests(":generators:test-generator"))
|
||||||
compile(project(":compiler:frontend.java"))
|
compile(project(":compiler:frontend.java"))
|
||||||
compile(project(":js:js.frontend"))
|
compile(project(":js:js.frontend"))
|
||||||
compile(projectRuntimeJar(":kotlin-preloader"))
|
compile(projectRuntimeJar(":kotlin-preloader"))
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.jps
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.generators.TestGroup
|
||||||
|
import org.jetbrains.kotlin.generators.impl.generateTestGroupSuite
|
||||||
|
import org.jetbrains.kotlin.jps.build.*
|
||||||
|
import org.jetbrains.kotlin.jps.incremental.AbstractJsProtoComparisonTest
|
||||||
|
import org.jetbrains.kotlin.jps.incremental.AbstractJvmProtoComparisonTest
|
||||||
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
System.setProperty("java.awt.headless", "true")
|
||||||
|
|
||||||
|
generateTestGroupSuite(args) {
|
||||||
|
testGroup("jps/jps-plugin/jps-tests/test", "jps/jps-plugin/testData") {
|
||||||
|
testClass<AbstractIncrementalJvmJpsTest> {
|
||||||
|
model("incremental/multiModule/common", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR)
|
||||||
|
model("incremental/multiModule/jvm", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR)
|
||||||
|
model(
|
||||||
|
"incremental/multiModule/multiplatform/custom", extension = null, excludeParentDirs = true,
|
||||||
|
targetBackend = TargetBackend.JVM_IR
|
||||||
|
)
|
||||||
|
model("incremental/pureKotlin", extension = null, recursive = false, targetBackend = TargetBackend.JVM_IR)
|
||||||
|
model("incremental/withJava", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR)
|
||||||
|
model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR)
|
||||||
|
model(
|
||||||
|
"incremental/classHierarchyAffected", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractIncrementalJsJpsTest> {
|
||||||
|
model("incremental/multiModule/common", extension = null, excludeParentDirs = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractMultiplatformJpsTestWithGeneratedContent> {
|
||||||
|
model(
|
||||||
|
"incremental/multiModule/multiplatform/withGeneratedContent", extension = null, excludeParentDirs = true,
|
||||||
|
testClassName = "MultiplatformMultiModule", recursive = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractJvmLookupTrackerTest> {
|
||||||
|
model("incremental/lookupTracker/jvm", extension = null, recursive = false)
|
||||||
|
}
|
||||||
|
testClass<AbstractJsLookupTrackerTest> {
|
||||||
|
model("incremental/lookupTracker/js", extension = null, recursive = false)
|
||||||
|
}
|
||||||
|
testClass<AbstractJsKlibLookupTrackerTest> {
|
||||||
|
// todo: investigate why lookups are different from non-klib js
|
||||||
|
model("incremental/lookupTracker/jsKlib", extension = null, recursive = false)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractIncrementalLazyCachesTest> {
|
||||||
|
model("incremental/lazyKotlinCaches", extension = null, excludeParentDirs = true)
|
||||||
|
model("incremental/changeIncrementalOption", extension = null, excludeParentDirs = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractIncrementalCacheVersionChangedTest> {
|
||||||
|
model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractDataContainerVersionChangedTest> {
|
||||||
|
model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
testGroup("jps/jps-plugin/jps-tests/test", "jps/jps-plugin/testData") {
|
||||||
|
fun TestGroup.TestClass.commonProtoComparisonTests() {
|
||||||
|
model("comparison/classSignatureChange", extension = null, excludeParentDirs = true)
|
||||||
|
model("comparison/classPrivateOnlyChange", extension = null, excludeParentDirs = true)
|
||||||
|
model("comparison/classMembersOnlyChanged", extension = null, excludeParentDirs = true)
|
||||||
|
model("comparison/packageMembers", extension = null, excludeParentDirs = true)
|
||||||
|
model("comparison/unchanged", extension = null, excludeParentDirs = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractJvmProtoComparisonTest> {
|
||||||
|
commonProtoComparisonTests()
|
||||||
|
model("comparison/jvmOnly", extension = null, excludeParentDirs = true)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractJsProtoComparisonTest> {
|
||||||
|
commonProtoComparisonTests()
|
||||||
|
model("comparison/jsOnly", extension = null, excludeParentDirs = true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
-21
@@ -8,27 +8,6 @@ package org.jetbrains.kotlin.jps.build.dependeciestxt
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
|
||||||
* Utility for generating common/platform module stub contents based on it's dependencies.
|
|
||||||
*/
|
|
||||||
fun actualizeMppJpsIncTestCaseDirs(rootDir: String, dir: String) {
|
|
||||||
val rootDirFile = File("$rootDir/$dir")
|
|
||||||
check(rootDirFile.isDirectory) { "`$rootDirFile` is not a directory" }
|
|
||||||
|
|
||||||
rootDirFile.listFiles { it: File -> it.isDirectory }.forEach { dirFile ->
|
|
||||||
val dependenciesTxtFile = File(dirFile, "dependencies.txt")
|
|
||||||
if (dependenciesTxtFile.exists()) {
|
|
||||||
val fileTitle = "$dir/${dirFile.name}/dependencies.txt"
|
|
||||||
val dependenciesTxt = ModulesTxtBuilder().readFile(dependenciesTxtFile, fileTitle)
|
|
||||||
|
|
||||||
MppJpsIncTestsGenerator(dependenciesTxt) { File(dirFile, it.name) }
|
|
||||||
.actualizeTestCasesDirs(dirFile)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
class MppJpsIncTestsGenerator(val txt: ModulesTxt, val testCaseDirProvider: (TestCase) -> File) {
|
class MppJpsIncTestsGenerator(val txt: ModulesTxt, val testCaseDirProvider: (TestCase) -> File) {
|
||||||
val ModulesTxt.Module.capitalName get() = name.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }
|
val ModulesTxt.Module.capitalName get() = name.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user