Extract kotlin.idea module tests into separate module

This commit is required to split big idea module into smaller modules for more
precise dependency configurations in order to get rid of circular dependencies
with kotlin.idea module

Before this commit:
```
Project kotlin-ide: there is circular dependency between tests of 'kotlin.tests-common' module,
tests of 'kotlin.j2k.old' module, tests of 'kotlin.core' module, tests of 'kotlin.maven' module,
tests of 'kotlin.gradle.gradle-tooling' module, tests of 'kotlin.test-framework' module,
tests of 'kotlin.compiler-plugins.kotlinx-serialization' module,
tests of 'kotlin.compiler-plugins.parcelize' module, tests of 'kotlin.compiler-plugins.allopen' module,
tests of 'kotlin.compiler-plugins.noarg' module, tests of 'kotlin.gradle.gradle-idea' module,
tests of 'kotlin.gradle.gradle-native' module, tests of 'kotlin.native' module,
tests of 'kotlin.j2k.new' module, tests of 'kotlin.idea' module, tests of 'kotlin.uast.uast-kotlin' module
```

After this commit:
```
Project kotlin-ide: there is circular dependency between tests of 'kotlin.tests-common' module,
tests of 'kotlin.j2k.old' module, tests of 'kotlin.core' module, tests of 'kotlin.maven' module,
tests of 'kotlin.gradle.gradle-tooling' module, tests of 'kotlin.test-framework' module,
tests of 'kotlin.native' module, tests of 'kotlin.j2k.new' module,
tests of 'kotlin.idea.tests' module, tests of 'kotlin.uast.uast-kotlin' module
```

GitOrigin-RevId: 9a2c7d1a6e542126b74fbaae64e0bdbaa4648c43
This commit is contained in:
Nikita Bobko
2021-04-07 12:20:14 +02:00
committed by intellij-monorepo-bot
parent c7bdfdbaaa
commit 55c5c507f8
57 changed files with 142 additions and 101 deletions

View File

@@ -33,6 +33,7 @@
<orderEntry type="module" module-name="kotlin.jps-common" scope="TEST" />
<orderEntry type="module" module-name="kotlin.tests-common" scope="TEST" />
<orderEntry type="module" module-name="kotlin.test-framework" scope="TEST" />
<orderEntry type="module" module-name="kotlin.core" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.core.impl" />
<orderEntry type="module" module-name="intellij.java.psi" />
<orderEntry type="module" module-name="intellij.gradle.toolingExtension" />

View File

@@ -35,5 +35,6 @@
<orderEntry type="module" module-name="kotlin.test-framework" scope="TEST" />
<orderEntry type="module" module-name="intellij.java.psi.impl" />
<orderEntry type="module" module-name="intellij.gradle.common" />
<orderEntry type="module" module-name="kotlin.core" scope="TEST" />
</component>
</module>

View File

@@ -29,6 +29,7 @@
<orderEntry type="module" module-name="kotlin.tests-common" scope="TEST" />
<orderEntry type="module" module-name="kotlin.test-framework" scope="TEST" />
<orderEntry type="module" module-name="kotlin.idea" />
<orderEntry type="module" module-name="kotlin.idea.tests" scope="TEST" />
<orderEntry type="module" module-name="kotlin.core" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.scripting" scope="TEST" />
<orderEntry type="module" module-name="kotlin.gradle.gradle-tooling" />

View File

@@ -18,7 +18,6 @@
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
</content>
<orderEntry type="inheritedJdk" />
@@ -43,8 +42,6 @@
<orderEntry type="module" module-name="kotlin.core" />
<orderEntry type="module" module-name="kotlin.formatter" />
<orderEntry type="module" module-name="kotlin.idea" />
<orderEntry type="module" module-name="kotlin.tests-common" scope="TEST" />
<orderEntry type="module" module-name="kotlin.test-framework" scope="TEST" />
<orderEntry type="module" module-name="intellij.java.impl" />
</component>
</module>

View File

@@ -44,7 +44,7 @@ class CompletionBindingContextProvider(project: Project) {
private val LOG = Logger.getInstance(CompletionBindingContextProvider::class.java)
@get:TestOnly
internal var TEST_LOG: StringBuilder? = null
var TEST_LOG: StringBuilder? = null
companion object {
fun getInstance(project: Project): CompletionBindingContextProvider = project.getServiceSafe()

View File

@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.test.KotlinRoot
import org.junit.Assert
@JvmField
val COMPLETION_TEST_DATA_BASE = KotlinRoot.DIR.resolve("completion/testData")
val COMPLETION_TEST_DATA_BASE = KotlinRoot.DIR.resolve("completion/tests/testData")
fun testCompletion(
fileText: String,

View File

@@ -13,7 +13,7 @@ import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@Deprecated("All tests from here to be moved to the generated test")
@TestRoot("completion/testData")
@TestRoot("completion/tests/testData")
@TestMetadata("handlers")
@RunWith(JUnit38ClassRunner::class)
class BasicCompletionHandlerTest : CompletionHandlerTestBase() {

View File

@@ -20,7 +20,7 @@ import org.junit.runner.RunWith
import java.io.File
@RunWith(JUnit38ClassRunner::class)
@TestRoot("idea")
@TestRoot("idea/tests")
@TestDataPath("\$CONTENT_ROOT")
@TestMetadata("testData/handlers/multifile")
class CompletionMultiFileHandlerTest : KotlinFixtureCompletionBaseTestCase() {

View File

@@ -17,7 +17,7 @@ import org.junit.runner.RunWith;
* DO NOT MODIFY MANUALLY.
*/
@SuppressWarnings("all")
@TestRoot("completion")
@TestRoot("completion/tests")
@TestDataPath("$CONTENT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/weighers/smart")

View File

@@ -27,7 +27,7 @@
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-build-common-tests" scope="TEST" />
<orderEntry type="library" scope="TEST" name="Guava" level="project" />
<orderEntry type="module" module-name="kotlin.jvm-debugger.test" />
<orderEntry type="module" module-name="kotlin.idea" />
<orderEntry type="module" module-name="kotlin.idea.tests" />
<orderEntry type="module" module-name="kotlin.fir" />
<orderEntry type="module" module-name="kotlin.scripting-support" />
<orderEntry type="module" module-name="kotlin.maven" />

View File

@@ -252,7 +252,7 @@ private fun assembleWorkspace(): TWorkspace = workspace {
}
}
testGroup("idea") {
testGroup("idea/tests") {
testClass<AbstractAdditionalResolveDescriptorRendererTest> {
model("resolve/additionalLazyResolve")
}
@@ -975,7 +975,7 @@ private fun assembleWorkspace(): TWorkspace = workspace {
}
}
testGroup("fir-low-level-api", testDataPath = "../idea/testData") {
testGroup("fir-low-level-api", testDataPath = "../idea/tests/testData") {
testClass<AbstractFirMultiModuleResolveTest> {
model("fir/multiModule", isRecursive = false, pattern = DIRECTORY)
}
@@ -1025,7 +1025,7 @@ private fun assembleWorkspace(): TWorkspace = workspace {
}
}
testGroup("idea/idea-fir/tests", "idea/testData") {
testGroup("idea/idea-fir/tests", "idea/tests/testData") {
testClass<AbstractFirReferenceResolveTest> {
model("resolve/references", pattern = KT_WITHOUT_DOTS)
}
@@ -1051,7 +1051,7 @@ private fun assembleWorkspace(): TWorkspace = workspace {
}
}
testGroup("idea/idea-fir/tests", "idea/testData/findUsages") {
testGroup("idea/idea-fir/tests", "idea/tests/testData/findUsages") {
testClass<AbstractFindUsagesFirTest> {
model("kotlin", pattern = """^(.+)\.0\.(kt|kts)$""")
@@ -1104,14 +1104,14 @@ private fun assembleWorkspace(): TWorkspace = workspace {
}
}
testGroup("gradle/gradle-idea", testDataPath = "../../idea/testData") {
testGroup("gradle/gradle-idea", testDataPath = "../../idea/tests/testData") {
testClass<AbstractGradleConfigureProjectByChangingFileTest> {
model("configuration/gradle", pattern = DIRECTORY, isRecursive = false, testMethodName = "doTestGradle")
model("configuration/gsk", pattern = DIRECTORY, isRecursive = false, testMethodName = "doTestGradle")
}
}
testGroup("idea") {
testGroup("idea/tests") {
testClass<AbstractResolveByStubTest> {
model("compiler/loadJava/compiledKotlin")
}
@@ -1156,7 +1156,7 @@ private fun assembleWorkspace(): TWorkspace = workspace {
}
}
testGroup("completion") {
testGroup("completion/tests") {
testClass<AbstractCompiledKotlinInJavaCompletionTest> {
model("injava", pattern = JAVA, isRecursive = false)
}
@@ -1270,7 +1270,7 @@ private fun assembleWorkspace(): TWorkspace = workspace {
}
//TODO: move these tests into idea-completion module
testGroup("idea", testDataPath = "../completion/testData") {
testGroup("idea/tests", testDataPath = "../../completion/tests/testData") {
testClass<AbstractCodeFragmentCompletionHandlerTest> {
model("handlers/runtimeCast")
}
@@ -1385,7 +1385,7 @@ private fun assembleWorkspace(): TWorkspace = workspace {
}
}
testGroup("performance-tests", testDataPath = "../idea/testData") {
testGroup("performance-tests", testDataPath = "../idea/tests/testData") {
testClass<AbstractPerformanceJavaToKotlinCopyPasteConversionTest> {
model("copyPaste/conversion", testMethodName = "doPerfTest", pattern = """^([^\.]+)\.java$""".toRegex())
}
@@ -1412,7 +1412,7 @@ private fun assembleWorkspace(): TWorkspace = workspace {
}
}
testGroup("performance-tests", testDataPath = "../completion/testData") {
testGroup("performance-tests", testDataPath = "../completion/tests/testData") {
testClass<AbstractPerformanceCompletionIncrementalResolveTest> {
model("incrementalResolve", testMethodName = "doPerfTest")
}

View File

@@ -43,6 +43,7 @@
<orderEntry type="module" module-name="kotlin.jps-common" />
<orderEntry type="module" module-name="kotlin.jvm" />
<orderEntry type="module" module-name="kotlin.idea" />
<orderEntry type="module" module-name="kotlin.idea.tests" scope="TEST" />
<orderEntry type="module" module-name="kotlin.formatter" />
<orderEntry type="module" module-name="kotlin.gradle.gradle-tooling" />
<orderEntry type="module" module-name="kotlin.jvm-debugger.core" />
@@ -74,4 +75,4 @@
<orderEntry type="module" module-name="intellij.platform.core.ui" />
<orderEntry type="module" module-name="intellij.platform.ide.util.io" />
</component>
</module>
</module>

View File

@@ -18,18 +18,15 @@
<exclude-output />
<content url="file://$MODULE_DIR$/../completion">
<sourceFolder url="file://$MODULE_DIR$/../completion/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/../completion/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/../completion/src" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/resources-en" type="java-resource" />
</content>
<content url="file://$MODULE_DIR$/../live-templates">
<sourceFolder url="file://$MODULE_DIR$/../live-templates/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../live-templates/test" isTestSource="true" />
</content>
<content url="file://$MODULE_DIR$/../resources-descriptors">
<sourceFolder url="file://$MODULE_DIR$/../resources-descriptors" type="java-resource" />
@@ -48,14 +45,10 @@
<orderEntry type="library" name="swingx" level="project" />
<orderEntry type="library" name="ASM" level="project" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="library" scope="TEST" name="kotlin-test" level="project" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-script-runtime" scope="TEST" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-scripting-compiler" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-scripting-compiler-impl" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-scripting-common" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-scripting-jvm" />
<orderEntry type="module" module-name="kotlinc-delegator.sam-with-receiver-compiler-plugin" scope="TEST" />
<orderEntry type="module" module-name="kotlinc-delegator.android-extensions-compiler-plugin" scope="TEST" />
<orderEntry type="module" module-name="kotlin.common" />
<orderEntry type="module" module-name="kotlin.core" />
<orderEntry type="module" module-name="kotlin.fir.frontend-independent" />
@@ -67,48 +60,24 @@
<orderEntry type="module" module-name="kotlin.gradle.gradle-tooling" />
<orderEntry type="module" module-name="kotlin.jvm-debugger.sequence" />
<orderEntry type="module" module-name="kotlin.scripting" />
<orderEntry type="module" module-name="kotlin.jvm" scope="TEST" />
<orderEntry type="module" module-name="kotlin.jvm-debugger.core" />
<orderEntry type="module" module-name="kotlin.line-indent-provider" />
<orderEntry type="module" module-name="kotlin.test-framework" scope="TEST" />
<orderEntry type="module" module-name="kotlin.tests-common" scope="TEST" />
<orderEntry type="module" module-name="kotlin.repl" scope="TEST" />
<orderEntry type="module" module-name="kotlin.jvm-debugger.util" scope="TEST" />
<orderEntry type="module" module-name="kotlin.native" scope="TEST" />
<orderEntry type="module" module-name="kotlin.gradle.gradle-native" scope="TEST" />
<orderEntry type="module" module-name="kotlin.maven" scope="TEST" />
<orderEntry type="module" module-name="kotlin.uast.uast-kotlin" scope="TEST" />
<orderEntry type="module" module-name="kotlin.uast.uast-kotlin-idea" scope="TEST" />
<orderEntry type="module" module-name="kotlin.jvm-debugger.evaluation" scope="TEST" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.sam-with-receiver" scope="TEST" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.noarg" scope="TEST" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.kotlinx-serialization" scope="TEST" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.allopen" scope="TEST" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.parcelize" scope="TEST" />
<orderEntry type="module" module-name="kotlin.j2k.services" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.externalSystem" />
<orderEntry type="module" module-name="intellij.platform.ide.impl" />
<orderEntry type="module" module-name="intellij.platform.statistics" exported="" />
<orderEntry type="module" module-name="intellij.platform.vcs.impl" />
<orderEntry type="module" module-name="intellij.platform.diff.impl" />
<orderEntry type="module" module-name="intellij.platform.langInjection" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.serviceContainer" scope="TEST" />
<orderEntry type="module" module-name="intellij.jvm.analysis" />
<orderEntry type="module" module-name="intellij.jvm.analysis.impl" scope="TEST" />
<orderEntry type="module" module-name="intellij.java" />
<orderEntry type="module" module-name="intellij.java.impl" />
<orderEntry type="module" module-name="intellij.java.ui" />
<orderEntry type="module" module-name="intellij.java.execution" />
<orderEntry type="module" module-name="intellij.java.compiler" />
<orderEntry type="module" module-name="intellij.java.execution.impl" scope="TEST" />
<orderEntry type="module" module-name="intellij.junit" scope="TEST" />
<orderEntry type="module" module-name="intellij.groovy.psi" scope="TEST" />
<orderEntry type="module" module-name="intellij.gradle.common" />
<orderEntry type="module" module-name="intellij.markdown" />
<orderEntry type="module" module-name="intellij.regexp" />
<orderEntry type="module" module-name="intellij.spellchecker" />
<orderEntry type="module" module-name="intellij.copyright" />
<orderEntry type="module" module-name="intellij.properties.psi" scope="TEST" />
<orderEntry type="library" name="jaxb-api" level="project" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />
<orderEntry type="module" module-name="intellij.platform.lang.impl" />

View File

@@ -28,7 +28,7 @@ import org.jetbrains.kotlin.psi.psiUtil.hasActualModifier
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
class GotoSuperActionHandler : CodeInsightActionHandler {
internal data class SuperDeclarationsAndDescriptor(val supers: List<PsiElement>, val descriptor: DeclarationDescriptor?) {
data class SuperDeclarationsAndDescriptor(val supers: List<PsiElement>, val descriptor: DeclarationDescriptor?) {
constructor() : this(emptyList(), null)
companion object {

View File

@@ -32,7 +32,7 @@ fun notifyLegacyIsResolveModulePerSourceSetSettingIfNeeded(project: Project) {
)
}
internal fun notifyLegacyIsResolveModulePerSourceSetSettingIfNeeded(
fun notifyLegacyIsResolveModulePerSourceSetSettingIfNeeded(
project: Project,
notificationSuppressState: SuppressResolveModulePerSourceSetNotificationState,
isResolveModulePerSourceSetSetting: IsResolveModulePerSourceSetSetting
@@ -103,7 +103,7 @@ private val Project.gradleProjectSettings: List<GradleProjectSettings>
Accessing "isResolveModulePerSourceSet" setting
*/
internal interface IsResolveModulePerSourceSetSetting {
interface IsResolveModulePerSourceSetSetting {
var isResolveModulePerSourceSet: Boolean
companion object {
@@ -122,7 +122,7 @@ private class ProjectIsResolveModulePerSourceSetSetting(private val project: Pro
Storing State about Notification Suppress
*/
internal interface SuppressResolveModulePerSourceSetNotificationState {
interface SuppressResolveModulePerSourceSetNotificationState {
var isSuppressed: Boolean
companion object {
@@ -146,5 +146,4 @@ private class IdeResolveModulePerSourceSetComponent :
}
}
internal const val KOTLIN_UPDATE_IS_RESOLVE_MODULE_PER_SOURCE_SET_GROUP_ID =
"Update isResolveModulePerSourceSet setting"
const val KOTLIN_UPDATE_IS_RESOLVE_MODULE_PER_SOURCE_SET_GROUP_ID = "Update isResolveModulePerSourceSet setting"

View File

@@ -273,7 +273,7 @@ private class TemplateTokenSequence(private val inputString: String) : Sequence<
}
@TestOnly
internal fun createTemplateSequenceTokenString(input: String): String {
fun createTemplateSequenceTokenString(input: String): String {
return TemplateTokenSequence(input).map {
when (it) {
is LiteralChunk -> "LITERAL_CHUNK(${it.text})"

View File

@@ -133,7 +133,7 @@ class KotlinChangeSignature(
}
}
internal fun createSilentRefactoringProcessor(methodDescriptor: KotlinMethodDescriptor): BaseRefactoringProcessor? = selectRefactoringProcessor(
fun createSilentRefactoringProcessor(methodDescriptor: KotlinMethodDescriptor): BaseRefactoringProcessor? = selectRefactoringProcessor(
methodDescriptor,
propertyProcessor = { KotlinChangePropertySignatureDialog.createProcessorForSilentRefactoring(project, commandName, it) },
functionProcessor = {

View File

@@ -168,7 +168,7 @@ private fun unwrapElement(unwrappedUsage: KtReferenceExpression, referenced: Psi
return resultExpression.getQualifiedElementSelector() as KtReferenceExpression
}
internal class J2KInlineCache(private val strategy: UsageReplacementStrategy, private val originalText: String) {
class J2KInlineCache(private val strategy: UsageReplacementStrategy, private val originalText: String) {
/**
* @return [strategy] without validation if [elementToValidation] is null
*/
@@ -179,10 +179,10 @@ internal class J2KInlineCache(private val strategy: UsageReplacementStrategy, pr
companion object {
private val JAVA_TO_KOTLIN_INLINE_CACHE_KEY = Key<J2KInlineCache>("JAVA_TO_KOTLIN_INLINE_CACHE")
internal fun PsiElement.findUsageReplacementStrategy(withValidation: Boolean): UsageReplacementStrategy? =
fun PsiElement.findUsageReplacementStrategy(withValidation: Boolean): UsageReplacementStrategy? =
getUserData(JAVA_TO_KOTLIN_INLINE_CACHE_KEY)?.getStrategy(this.takeIf { withValidation })
internal fun PsiElement.setUsageReplacementStrategy(strategy: UsageReplacementStrategy): Unit =
fun PsiElement.setUsageReplacementStrategy(strategy: UsageReplacementStrategy): Unit =
putUserData(JAVA_TO_KOTLIN_INLINE_CACHE_KEY, J2KInlineCache(strategy, text))
internal fun findOrCreateUsageReplacementStrategy(javaMember: PsiMember, context: PsiElement): UsageReplacementStrategy? {

View File

@@ -86,7 +86,7 @@ internal fun buildCodeToInline(
)
}
internal fun Editor.findSimpleNameReference(): PsiReference? {
fun Editor.findSimpleNameReference(): PsiReference? {
val reference = TargetElementUtil.findReference(this, caretModel.offset) ?: return null
return when {
reference.element.language != KotlinLanguage.INSTANCE -> reference

View File

@@ -31,7 +31,7 @@ class AutomaticOverloadsRenamer(function: KtNamedFunction, newName: String) : Au
companion object {
@get:TestOnly
@set:TestOnly
internal var PsiElement.elementFilter: ((PsiElement) -> Boolean)? by UserDataProperty(Key.create("ELEMENT_FILTER"))
var PsiElement.elementFilter: ((PsiElement) -> Boolean)? by UserDataProperty(Key.create("ELEMENT_FILTER"))
}
init {

View File

@@ -37,7 +37,7 @@ class KotlinRenameDispatcherHandler : RenameHandler {
}
}
internal fun getRenameHandler(dataContext: DataContext): RenameHandler? {
fun getRenameHandler(dataContext: DataContext): RenameHandler? {
val availableHandlers = handlers.filterTo(LinkedHashSet()) { it.isRenaming(dataContext) }
availableHandlers.singleOrNull()?.let { return it }
availableHandlers.firstIsInstanceOrNull<KotlinMemberInplaceRenameHandler>()?.let { availableHandlers -= it }

View File

@@ -64,7 +64,7 @@ import java.util.*
class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
companion object {
@set:TestOnly
internal var Project.ALLOW_LIFTING_ACTUAL_PARAMETER_TO_EXPECTED
var Project.ALLOW_LIFTING_ACTUAL_PARAMETER_TO_EXPECTED
by NotNullableUserDataProperty(Key.create("ALLOW_LIFTING_ACTUAL_PARAMETER_TO_EXPECTED"), true)
private var KtDeclaration.dropActualModifier: Boolean? by UserDataProperty(Key.create("DROP_ACTUAL_MODIFIER"))

View File

@@ -133,12 +133,12 @@ enum class DeclarationType {
}
}
internal data class KotlinSignatureAdditionalData(
data class KotlinSignatureAdditionalData(
val declarationType: DeclarationType,
val receiverType: String?
) : SuggestedRefactoringSupport.SignatureAdditionalData
internal data class KotlinParameterAdditionalData(
data class KotlinParameterAdditionalData(
val defaultValue: String?,
val modifiers: String
) : SuggestedRefactoringSupport.ParameterAdditionalData
@@ -149,5 +149,5 @@ internal val Signature.receiverType: String?
internal val Parameter.defaultValue: String?
get() = (additionalData as KotlinParameterAdditionalData?)?.defaultValue
internal val Parameter.modifiers: String
val Parameter.modifiers: String
get() = (additionalData as KotlinParameterAdditionalData?)?.modifiers ?: ""

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../../live-templates/tests">
<sourceFolder url="file://$MODULE_DIR$/../../live-templates/tests/test" isTestSource="true" />
</content>
<content url="file://$MODULE_DIR$/../../completion/tests">
<sourceFolder url="file://$MODULE_DIR$/../../completion/tests/test" isTestSource="true" />
</content>
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="kotlinc.kotlin-stdlib-jdk8" level="project" />
<orderEntry type="library" scope="TEST" name="javaslang" level="project" />
<orderEntry type="library" scope="TEST" name="kotlin-test" level="project" />
<orderEntry type="library" scope="TEST" name="kotlinc.android-extensions-compiler-plugin" level="project" />
<orderEntry type="library" scope="TEST" name="gson" level="project" />
<orderEntry type="library" scope="TEST" name="Guava" level="project" />
<orderEntry type="library" scope="TEST" name="fastutil-min" level="project" />
<orderEntry type="module" module-name="kotlin.jvm" scope="TEST" />
<orderEntry type="module" module-name="kotlin.test-framework" scope="TEST" />
<orderEntry type="module" module-name="kotlin.tests-common" scope="TEST" />
<orderEntry type="module" module-name="kotlin.repl" scope="TEST" />
<orderEntry type="module" module-name="kotlin.line-indent-provider" scope="TEST" />
<orderEntry type="module" module-name="kotlin.jvm-debugger.util" scope="TEST" />
<orderEntry type="module" module-name="kotlin.native" scope="TEST" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-compiler" scope="TEST" />
<orderEntry type="module" module-name="kotlin.core" scope="TEST" />
<orderEntry type="module" module-name="kotlin.common" scope="TEST" />
<orderEntry type="module" module-name="kotlin.fir.frontend-independent" scope="TEST" />
<orderEntry type="module" module-name="kotlinc-delegator.sam-with-receiver-compiler-plugin" scope="TEST" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-reflect" scope="TEST" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-script-runtime" scope="TEST" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-scripting-common" scope="TEST" />
<orderEntry type="module" module-name="kotlinc-delegator.kotlin-scripting-jvm" scope="TEST" />
<orderEntry type="module" module-name="kotlin.idea" scope="TEST" />
<orderEntry type="module" module-name="kotlin.gradle.gradle-idea" scope="RUNTIME" />
<orderEntry type="module" module-name="kotlin.gradle.gradle-native" scope="RUNTIME" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.sam-with-receiver" scope="RUNTIME" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.noarg" scope="RUNTIME" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.kotlinx-serialization" scope="RUNTIME" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.allopen" scope="RUNTIME" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.parcelize" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.platform.core" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.structuralSearch" scope="TEST" />
<orderEntry type="module" module-name="intellij.gradle.common" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.ide.util.io" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.duplicates.analysis" scope="TEST" />
<orderEntry type="module" module-name="intellij.spellchecker" scope="TEST" />
<orderEntry type="module" module-name="kotlin.maven" scope="TEST" />
<orderEntry type="module" module-name="kotlin.uast.uast-kotlin" scope="TEST" />
<orderEntry type="module" module-name="kotlin.uast.uast-kotlin-idea" scope="TEST" />
<orderEntry type="module" module-name="kotlin.jvm-debugger.evaluation" scope="TEST" />
<orderEntry type="module" module-name="kotlin.j2k.services" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.langInjection" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.serviceContainer" scope="TEST" />
<orderEntry type="module" module-name="intellij.jvm.analysis.impl" scope="TEST" />
<orderEntry type="module" module-name="intellij.java.execution.impl" scope="TEST" />
<orderEntry type="module" module-name="intellij.copyright" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.codeStyle.impl" scope="TEST" />
<orderEntry type="module" module-name="intellij.junit" scope="TEST" />
<orderEntry type="module" module-name="intellij.groovy.psi" scope="TEST" />
<orderEntry type="module" module-name="intellij.statsCollector.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.properties.psi" scope="TEST" />
</component>
</module>

View File

@@ -24,7 +24,7 @@ import org.jetbrains.kotlin.test.TestRoot
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/asJava/fileLightClass")
@RunWith(JUnit38ClassRunner::class)
class KtFileLightClassTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -23,7 +23,7 @@ import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
// see KtFileLightClassTest
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/asJava/fileLightClass")
@RunWith(JUnit38ClassRunner::class)
class LightClassFromTextTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -21,7 +21,7 @@ import org.junit.runner.RunWith
import java.io.File
import kotlin.test.assertNotNull
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/decompiler/lightClassesOrder")
@RunWith(JUnit38ClassRunner::class)
class LightClassesClasspathSortingTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.test.TestRoot
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/checker/custom")
@RunWith(JUnit38ClassRunner::class)
class KotlinHighlightingPassCustomTest : AbstractKotlinHighlightingPassTest() {

View File

@@ -18,7 +18,7 @@ import org.junit.runner.RunWith;
import java.io.File;
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/wordSelection")
@RunWith(JUnit38ClassRunner.class)
public class WordSelectionTest extends KotlinLightCodeInsightFixtureTestCase {

View File

@@ -29,7 +29,7 @@ import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
import kotlin.reflect.KMutableProperty0
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/cache")
@RunWith(JUnit38ClassRunner::class)
class KotlinShortNamesCacheTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -21,7 +21,7 @@ import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
import java.io.File
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/highlightingWithDependentLibraries")
@RunWith(JUnit38ClassRunner::class)
class HighlightingWithDependentLibrariesTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.test.TestRoot
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestDataPath("\$CONTENT_ROOT")
@RunWith(JUnit38ClassRunner::class)
@TestMetadata("testData/codeInsight/overrideImplement/withLib")

View File

@@ -17,7 +17,7 @@ import org.junit.runner.RunWith;
* DO NOT MODIFY MANUALLY.
*/
@SuppressWarnings("all")
@TestRoot("idea")
@TestRoot("idea/tests")
@TestDataPath("$CONTENT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("testData/codeInsight/hints/types")

View File

@@ -11,6 +11,7 @@ import com.intellij.psi.PsiManager
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.util.ThrowableRunnable
import org.jetbrains.kotlin.idea.completion.test.AbstractJvmBasicCompletionTest
import org.jetbrains.kotlin.idea.completion.test.COMPLETION_TEST_DATA_BASE
import org.jetbrains.kotlin.idea.completion.test.testCompletion
import org.jetbrains.kotlin.idea.debugger.getContextElement
import org.jetbrains.kotlin.idea.test.MockLibraryFacility
@@ -28,7 +29,7 @@ import java.io.File
@RunWith(JUnit38ClassRunner::class)
class CodeFragmentCompletionInLibraryTest : AbstractJvmBasicCompletionTest() {
companion object {
private val LIBRARY_SRC = File(KotlinRoot.DIR, "completion/testData/codeFragmentInLibrarySource/customLibrary/")
private val LIBRARY_SRC = COMPLETION_TEST_DATA_BASE.resolve("codeFragmentInLibrarySource/customLibrary/")
}
private val mockLibraryFacility = MockLibraryFacility(source = LIBRARY_SRC)

View File

@@ -17,7 +17,7 @@ import org.junit.Assert
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/kdoc/inCompletion")
@RunWith(JUnit38ClassRunner::class)
class QuickDocInCompletionTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -22,7 +22,7 @@ import org.junit.Assert
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/kdoc/navigate")
@RunWith(JUnit38ClassRunner::class)
class QuickDocNavigationTest() : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.test.TestRoot
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/folding/afterOptimizeImports")
@RunWith(JUnit38ClassRunner::class)
class FoldingAfterOptimizeImportsTest : AbstractKotlinFoldingTest() {

View File

@@ -24,7 +24,7 @@ import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
import java.io.File
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/highlighterJsr305/project")
@RunWith(JUnit38ClassRunner::class)
class Jsr305HighlightingTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -19,7 +19,7 @@ import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
import org.jetbrains.kotlin.idea.artifacts.KotlinArtifacts.Companion.instance as KotlinArtifacts
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/inspections/blockingCallsDetection")
@RunWith(JUnit38ClassRunner::class)
class CoroutineNonBlockingContextDetectionTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -17,7 +17,7 @@ import org.jetbrains.kotlin.test.TestRoot
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/inspections/cleanup")
@RunWith(JUnit38ClassRunner::class)
class KotlinCleanupInspectionTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -25,7 +25,7 @@ import org.junit.runner.RunWith;
import static org.jetbrains.kotlin.asJava.LightClassUtilsKt.toLightClass;
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/javaFacade")
@RunWith(JUnit38ClassRunner.class)
public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase {

View File

@@ -14,7 +14,7 @@ import org.jetbrains.kotlin.test.TestRoot;
import org.junit.internal.runners.JUnit38ClassRunner;
import org.junit.runner.RunWith;
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/kdoc/rename")
@RunWith(JUnit38ClassRunner.class)
public class KdocRenameTest extends KotlinLightCodeInsightFixtureTestCase {

View File

@@ -18,7 +18,7 @@ import org.jetbrains.kotlin.test.TestMetadata
import org.jetbrains.kotlin.test.TestRoot
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance
@TestRoot("idea")
@TestRoot("idea/tests")
@TestDataPath("\$CONTENT_ROOT")
@TestMetadata("testData/quickfix.special/deprecatedSymbolUsage")
class DeprecatedSymbolUsageFixSpecialTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -21,7 +21,7 @@ import org.jetbrains.kotlin.test.TestRoot
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/refactoring/nameSuggester")
@RunWith(JUnit38ClassRunner::class)
class KotlinNameSuggesterTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase;
import org.jetbrains.kotlin.test.TestMetadata;
import org.jetbrains.kotlin.test.TestRoot;
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/refactoring/rename/simpleNameReference")
public class SimpleNameReferenceRenameTest extends KotlinLightCodeInsightFixtureTestCase {
public void testRenameLabel() throws Exception {

View File

@@ -32,7 +32,7 @@ import java.util.List;
import static org.jetbrains.kotlin.test.util.ReferenceUtils.renderAsGotoImplementation;
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/resolve/builtins")
@RunWith(JUnit38ClassRunner.class)
public class BuiltInsReferenceResolverTest extends KotlinLightCodeInsightFixtureTestCase {

View File

@@ -14,7 +14,7 @@ import org.jetbrains.kotlin.test.TestRoot
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/search/definitions")
@RunWith(JUnit38ClassRunner::class)
class DefinitionsSearchTest : AbstractSearcherTest() {

View File

@@ -18,7 +18,7 @@ import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
import java.io.File
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/search/junit")
@RunWith(JUnit38ClassRunner::class)
class JUnitMembersSearcherTest : AbstractSearcherTest() {

View File

@@ -22,7 +22,7 @@ import org.junit.Assert
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/search/references")
@RunWith(JUnit38ClassRunner::class)
class KotlinReferencesSearchTest : AbstractSearcherTest() {

View File

@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.test.TestRoot
import org.junit.internal.runners.JUnit38ClassRunner
import org.junit.runner.RunWith
@TestRoot("idea")
@TestRoot("idea/tests")
@TestMetadata("testData/search/todo")
@RunWith(JUnit38ClassRunner::class)
class TodoSearchTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -28,7 +28,7 @@
<orderEntry type="module" module-name="kotlin.common" />
<orderEntry type="module" module-name="kotlin.core" />
<orderEntry type="module" module-name="kotlin.fir.frontend-independent" />
<orderEntry type="module" module-name="kotlin.idea" scope="TEST" />
<orderEntry type="module" module-name="kotlin.idea.tests" scope="TEST" />
<orderEntry type="module" module-name="kotlin.j2k.old" />
<orderEntry type="module" module-name="kotlin.j2k.idea" scope="TEST" />
<orderEntry type="module" module-name="kotlin.j2k.services" scope="TEST" />

View File

@@ -2,8 +2,7 @@
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
</content>
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="kotlin.common" />
@@ -57,5 +56,6 @@
<orderEntry type="module" module-name="kotlin.fir.frontend-independent" />
<orderEntry type="module" module-name="kotlin.line-indent-provider" />
<orderEntry type="module" module-name="kotlin.compiler-plugins.parcelize" />
<orderEntry type="module" module-name="kotlin.idea.tests" />
</component>
</module>

View File

@@ -14,7 +14,7 @@ import org.jetbrains.kotlin.test.TestMetadata
import org.jetbrains.kotlin.test.TestRoot
import org.junit.runner.RunWith
@TestRoot("live-templates")
@TestRoot("live-templates/tests")
@TestMetadata("testData/context")
@RunWith(JUnit38ClassRunner::class)
class LiveTemplatesContextTest : KotlinLightCodeInsightFixtureTestCase() {

View File

@@ -28,7 +28,7 @@ import java.util.*
class LiveTemplatesTest : KotlinLightCodeInsightFixtureTestCase() {
override fun setUp() {
super.setUp()
myFixture.testDataPath = KotlinRoot.DIR.resolve("live-templates/testData").slashedPath
myFixture.testDataPath = KotlinRoot.DIR.resolve("live-templates/tests/testData").slashedPath
TemplateManagerImpl.setTemplateTesting(testRootDisposable)
}

View File

@@ -33,6 +33,7 @@
<orderEntry type="module" module-name="kotlin.fir.frontend-independent" scope="TEST" />
<orderEntry type="module" module-name="kotlin.gradle.gradle-tooling" scope="TEST" />
<orderEntry type="module" module-name="kotlin.idea" scope="TEST" />
<orderEntry type="module" module-name="kotlin.idea.tests" scope="TEST" />
<orderEntry type="module" module-name="kotlin.line-indent-provider" scope="TEST" />
<orderEntry type="module" module-name="kotlin.gradle.gradle-idea" scope="TEST" />
<orderEntry type="module" module-name="kotlin.native" scope="TEST" />

View File

@@ -34,6 +34,7 @@
<orderEntry type="module" module-name="kotlin.common" scope="TEST" />
<orderEntry type="module" module-name="kotlin.core" scope="TEST" />
<orderEntry type="module" module-name="kotlin.fir.frontend-independent" scope="TEST" />
<orderEntry type="module" module-name="kotlin.idea.tests" scope="TEST" />
<orderEntry type="module" module-name="kotlin.idea" scope="TEST" />
<orderEntry type="module" module-name="kotlin.jvm" scope="TEST" />
<orderEntry type="module" module-name="kotlin.jvm-debugger.coroutines" scope="TEST" />

View File

@@ -25,7 +25,7 @@ import java.io.File
import java.util.*
@JvmField
val IDEA_TEST_DATA_DIR = File(KotlinRoot.DIR, "idea/testData")
val IDEA_TEST_DATA_DIR = File(KotlinRoot.DIR, "idea/tests/testData")
fun KtFile.dumpTextWithErrors(ignoreErrors: Set<DiagnosticFactory<*>> = emptySet()): String {
val text = text