Support test directive for rendering full diagnostic messages
New `RENDER_DIAGNOSTICS_MESSAGES` directive forces test system render full messages for all diagnostics that found in test file
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
2866bd84a1
commit
68d7e51d32
@@ -140,6 +140,7 @@ abstract class BaseDiagnosticsTest : KotlinMultiFileTestWithJava<TestModule, Tes
|
||||
val dynamicCallDescriptors: List<DeclarationDescriptor> = ArrayList()
|
||||
val withNewInferenceDirective: Boolean
|
||||
val newInferenceEnabled: Boolean
|
||||
val renderDiagnosticMessages: Boolean
|
||||
|
||||
init {
|
||||
this.declareCheckType = CHECK_TYPE_DIRECTIVE in directives
|
||||
@@ -162,6 +163,7 @@ abstract class BaseDiagnosticsTest : KotlinMultiFileTestWithJava<TestModule, Tes
|
||||
this.clearText = CheckerTestUtil.parseDiagnosedRanges(addExtras(expectedText), diagnosedRanges)
|
||||
this.createKtFile = lazy { TestCheckerUtil.createCheckAndReturnPsiFile(fileName, clearText, project) }
|
||||
}
|
||||
this.renderDiagnosticMessages = RENDER_DIAGNOSTICS_MESSAGES in directives
|
||||
}
|
||||
|
||||
val ktFile: KtFile? by createKtFile
|
||||
@@ -302,7 +304,8 @@ abstract class BaseDiagnosticsTest : KotlinMultiFileTestWithJava<TestModule, Tes
|
||||
diagnosticToExpectedDiagnostic,
|
||||
{ file -> file.text },
|
||||
uncheckedDiagnostics,
|
||||
withNewInferenceDirective
|
||||
withNewInferenceDirective,
|
||||
renderDiagnosticMessages
|
||||
)
|
||||
)
|
||||
|
||||
@@ -375,6 +378,8 @@ abstract class BaseDiagnosticsTest : KotlinMultiFileTestWithJava<TestModule, Tes
|
||||
// Change it to "true" to load diagnostics for old inference to test new inference (ignore diagnostics with <NI; prefix)
|
||||
val USE_OLD_INFERENCE_DIAGNOSTICS_FOR_NI = false
|
||||
|
||||
val RENDER_DIAGNOSTICS_MESSAGES = "RENDER_DIAGNOSTICS_MESSAGES"
|
||||
|
||||
private fun parseDiagnosticFilterDirective(
|
||||
directiveMap: Map<String, String>,
|
||||
allowUnderscoreUsage: Boolean
|
||||
|
||||
Reference in New Issue
Block a user