[Tests] Add missing diagnostics handler to irText tests

Merge-request: KT-MR-11721
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
Vladimir Sukharev
2023-08-22 10:44:41 +00:00
committed by Space Team
parent ccfbb5f77a
commit 90904e4f8a
7 changed files with 21 additions and 14 deletions
@@ -1,9 +1,7 @@
// FIR_IDENTICAL
// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
annotation class A1
annotation class A2
annotation class A3
@[A1, A2, A3] fun test() {}
@[A1 A2 A3] fun test() {}
+2 -1
View File
@@ -2,6 +2,7 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// !IGNORE_ERRORS
// DIAGNOSTICS: -UNRESOLVED_REFERENCE -OVERLOAD_RESOLUTION_AMBIGUITY
val test1 = unresolved
@@ -10,4 +11,4 @@ val test2: Unresolved =
val test3 = 42.unresolved(56)
val test4 = 42 *
val test4 = 42 *<!SYNTAX!><!>
@@ -2,6 +2,7 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// !IGNORE_ERRORS
// DIAGNOSTICS: -BREAK_OR_CONTINUE_OUTSIDE_A_LOOP -NOT_A_LOOP_LABEL -UNRESOLVED_REFERENCE -BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY
fun test1() {
break
@@ -3,6 +3,7 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// !IGNORE_ERRORS
// DIAGNOSTICS: -NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER -BREAK_OR_CONTINUE_OUTSIDE_A_LOOP -UNEXPECTED_TRAILING_LAMBDA_ON_A_NEW_LINE -NO_VALUE_FOR_PARAMETER -NOT_A_LOOP_LABEL -UNRESOLVED_REFERENCE -TYPE_MISMATCH -BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY
// WITH_STDLIB
inline fun foo(block: () -> Unit) { block() }
@@ -1,27 +1,24 @@
// IGNORE_BACKEND_K1: JS_IR
// IGNORE_BACKEND_K1: JS_IR_ES6
fun test1(c: Boolean?) {
L@ while (true) {
L2@while (c ?: break)
L2@while (c ?: break) ;
}
}
fun test2(c: Boolean?) {
L@ while (true) {
L2@while (c ?: continue)
L2@while (c ?: continue) ;
}
}
fun test3(ss: List<String>?) {
L@ while (true) {
L2@for (s in ss ?: continue)
L2@for (s in ss ?: continue) ;
}
}
fun test4(ss: List<String>?) {
L@ while (true) {
L2@for (s in ss ?: break)
L2@for (s in ss ?: break) ;
}
}
@@ -4,7 +4,7 @@
// FILE: nnStringVsTXString.kt
fun <T> useTX(x: T, fn: () -> T) = fn()
fun testWithNullCheck {
fun testWithNullCheck() {
useTX("") { J.notNullString() }
}
@@ -19,9 +19,13 @@ import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_IR
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_KT_IR
import org.jetbrains.kotlin.test.FirParser
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_SIGNATURES
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.DIAGNOSTICS
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO
import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives
import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives.LINK_VIA_SIGNATURES
import org.jetbrains.kotlin.test.directives.configureFirParser
import org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicDiagnosticsHandler
import org.jetbrains.kotlin.test.frontend.fir.handlers.FirDiagnosticsHandler
import org.jetbrains.kotlin.test.model.*
import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest
import org.jetbrains.kotlin.test.services.sourceProviders.AdditionalDiagnosticsSourceFilesProvider
@@ -52,6 +56,8 @@ abstract class AbstractIrTextTest<FrontendOutput : ResultingArtifact.FrontendOut
+DUMP_KT_IR
+DUMP_SIGNATURES
+LINK_VIA_SIGNATURES
+REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO
DIAGNOSTICS with "-warnings"
}
useAfterAnalysisCheckers(
@@ -59,6 +65,7 @@ abstract class AbstractIrTextTest<FrontendOutput : ResultingArtifact.FrontendOut
)
applyConfigurators()
enableMetaInfoHandler()
useAdditionalSourceProviders(
::AdditionalDiagnosticsSourceFilesProvider,
@@ -69,13 +76,15 @@ abstract class AbstractIrTextTest<FrontendOutput : ResultingArtifact.FrontendOut
facadeStep(frontendFacade)
classicFrontendHandlersStep {
useHandlers(
::NoCompilationErrorsHandler
::NoCompilationErrorsHandler,
::ClassicDiagnosticsHandler
)
}
firHandlersStep {
useHandlers(
::NoFirCompilationErrorsHandler
::NoFirCompilationErrorsHandler,
::FirDiagnosticsHandler
)
}