FIR IDE: add tests based on compiler spec tests for ide
This commit is contained in:
+13
@@ -6,6 +6,7 @@
|
||||
package org.jetbrains.kotlin.idea.fir.low.level.api.compiler.based
|
||||
|
||||
import org.jetbrains.kotlin.test.WrappedException
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.model.AfterAnalysisChecker
|
||||
import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
@@ -58,4 +59,16 @@ class IdeTestIgnoreHandler(testServices: TestServices) : AfterAnalysisChecker(te
|
||||
}
|
||||
}
|
||||
|
||||
fun TestConfigurationBuilder.addIdeTestIgnoreHandler() {
|
||||
/* IdeTestIgnoreHandler should be executed after FirFailingTestSuppressor,
|
||||
otherwise IdeTestIgnoreHandler will suppress exceptions and FirFailingTestSuppressor will throw error
|
||||
saying that file .fir.fail exists but test passes
|
||||
*/
|
||||
forTestsMatching("*") {
|
||||
useAfterAnalysisCheckers(
|
||||
::IdeTestIgnoreHandler
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class TestWithFirIdeIgnoreAnnotationPassesException(override val message: String) : IllegalStateException()
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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.idea.fir.low.level.api.diagnostic.compiler.based
|
||||
|
||||
import org.jetbrains.kotlin.idea.fir.low.level.api.compiler.based.AbstractCompilerBasedTest
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.runners.baseFirDiagnosticTestConfiguration
|
||||
import org.jetbrains.kotlin.idea.fir.low.level.api.compiler.based.IdeTestIgnoreHandler
|
||||
import org.jetbrains.kotlin.idea.fir.low.level.api.compiler.based.addIdeTestIgnoreHandler
|
||||
import org.jetbrains.kotlin.test.runners.baseFirSpecDiagnosticTestConfiguration
|
||||
|
||||
abstract class AbstractDiagnosisCompilerTestDataSpecTest : AbstractCompilerBasedTest() {
|
||||
override fun TestConfigurationBuilder.configureTest() {
|
||||
baseFirDiagnosticTestConfiguration()
|
||||
baseFirSpecDiagnosticTestConfiguration()
|
||||
addIdeTestIgnoreHandler()
|
||||
}
|
||||
}
|
||||
+2
-9
@@ -9,18 +9,11 @@ import org.jetbrains.kotlin.idea.fir.low.level.api.compiler.based.AbstractCompil
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.runners.baseFirDiagnosticTestConfiguration
|
||||
import org.jetbrains.kotlin.idea.fir.low.level.api.compiler.based.IdeTestIgnoreHandler
|
||||
import org.jetbrains.kotlin.idea.fir.low.level.api.compiler.based.addIdeTestIgnoreHandler
|
||||
|
||||
abstract class AbstractDiagnosisCompilerTestDataTest : AbstractCompilerBasedTest() {
|
||||
override fun TestConfigurationBuilder.configureTest() {
|
||||
baseFirDiagnosticTestConfiguration()
|
||||
/* IdeTestIgnoreHandler should be executed after FirFailingTestSuppressor,
|
||||
otherwise IdeTestIgnoreHandler will suppress exceptions and FirFailingTestSuppressor will throw error
|
||||
saying that file .fir.fail exists but test passes
|
||||
*/
|
||||
forTestsMatching("*") {
|
||||
useAfterAnalysisCheckers(
|
||||
::IdeTestIgnoreHandler
|
||||
)
|
||||
}
|
||||
addIdeTestIgnoreHandler()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user