Build: got rid of @TestOnly annotations on fields and classes

This commit is contained in:
Sergey Rostov
2019-02-22 14:31:01 +03:00
parent c89d1af9fa
commit 17c0422d8f
13 changed files with 17 additions and 18 deletions
@@ -58,7 +58,7 @@ open class KtUltraLightClass(classOrObject: KtClassOrObject, internal val suppor
// This property may be removed once IntelliJ versions earlier than 2018.3 become unsupported
// And usages of that property may be replaced with relevant registry key
@Volatile
@TestOnly
@get:TestOnly
var forceUsingUltraLightClasses = false
}
@@ -408,7 +408,7 @@ private fun getAnnotationName(callee: KtExpression): String? {
return null
}
@TestOnly
@get:TestOnly
var accessAnnotationsClsDelegateIsAllowed = false
@TestOnly
@@ -62,11 +62,11 @@ class PsiBasedClassResolver @TestOnly constructor(private val targetClassFqName:
private var forceAmbiguityForNonAnnotations: Boolean = false
companion object {
@TestOnly
@get:TestOnly
val attempts = AtomicInteger()
@TestOnly
@get:TestOnly
val trueHits = AtomicInteger()
@TestOnly
@get:TestOnly
val falseHits = AtomicInteger()
private val PSI_BASED_CLASS_RESOLVER_KEY = Key<CachedValue<PsiBasedClassResolver>>("PsiBasedClassResolver")
@@ -72,7 +72,7 @@ class ExpressionsOfTypeProcessor(
private val possibleMatchHandler: (KtExpression) -> Unit,
private val possibleMatchesInScopeHandler: (SearchScope) -> Unit
) {
@TestOnly
/** For tests only */
enum class Mode {
ALWAYS_SMART,
ALWAYS_PLAIN,
@@ -80,9 +80,10 @@ class ExpressionsOfTypeProcessor(
}
companion object {
@TestOnly
@get:TestOnly
var mode = if (ApplicationManager.getApplication().isUnitTestMode) Mode.ALWAYS_SMART else Mode.PLAIN_WHEN_NEEDED
@TestOnly
@get:TestOnly
var testLog: MutableList<String>? = null
inline fun testLog(s: () -> String) {
@@ -53,7 +53,7 @@ import java.util.*
class CompletionBindingContextProvider(project: Project) {
private val LOG = Logger.getInstance(CompletionBindingContextProvider::class.java)
@TestOnly
@get:TestOnly
internal var TEST_LOG: StringBuilder? = null
companion object {
@@ -44,7 +44,7 @@ import org.jetbrains.kotlin.utils.addIfNotNull
import java.util.*
object DebuggerUtils {
@TestOnly
@get:TestOnly
var forceRanking = false
fun findSourceFileForClassIncludeLibrarySources(
@@ -286,7 +286,7 @@ class KotlinCodeFragmentFactory : CodeFragmentFactory() {
companion object {
private val LOG = Logger.getInstance(this::class.java)
@TestOnly
@get:TestOnly
val DEBUG_CONTEXT_FOR_TESTS: Key<DebuggerContextImpl> = Key.create("DEBUG_CONTEXT_FOR_TESTS")
const val FAKE_JAVA_CONTEXT_FUNCTION_NAME = "_java_locals_debug_fun_"
@@ -168,7 +168,6 @@ private class ScratchToolWindowFactory : ToolWindowFactory {
}
}
@TestOnly
private object TestOutputHandler : ScratchOutputHandlerAdapter() {
override fun handle(file: ScratchFile, expression: ScratchExpression, output: ScratchOutput) {
testPrint(file, output.text, expression)
@@ -376,6 +376,6 @@ class KotlinCopyPasteReferenceProcessor : CopyPastePostProcessor<KotlinReference
}
companion object {
@TestOnly var declarationsToImportSuggested: Collection<String> = emptyList()
@get:TestOnly var declarationsToImportSuggested: Collection<String> = emptyList()
}
}
@@ -80,7 +80,7 @@ class KtPostfixTemplateProvider : PostfixTemplateProvider {
/**
* In tests only one expression should be suggested, so in case there are many of them, save relevant items
*/
@TestOnly
@get:TestOnly
@Volatile
var previouslySuggestedExpressions = emptyList<String>()
}
@@ -195,7 +195,7 @@ class ConvertJavaCopyPasteProcessor : CopyPastePostProcessor<TextBlockTransferab
}
companion object {
@TestOnly var conversionPerformed: Boolean = false
@get:TestOnly var conversionPerformed: Boolean = false
}
}
@@ -281,6 +281,6 @@ class ConvertTextJavaCopyPasteProcessor : CopyPastePostProcessor<TextBlockTransf
}
companion object {
@TestOnly var conversionPerformed: Boolean = false
@get:TestOnly var conversionPerformed: Boolean = false
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
@@ -27,7 +27,6 @@ fun UsefulTestCase.forceUsingUltraLightClassesForTest() {
})
}
@TestOnly
object UltraLightChecker {
fun checkClassEquivalence(file: KtFile) {
for (ktClass in allClasses(file)) {