FIR IDE: ignore non-passing tests in compiler based tests
This commit is contained in:
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: foo/Some.java
|
||||
|
||||
package foo;
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: K1.kt
|
||||
class KSub : J1()
|
||||
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: K1.kt
|
||||
class K2: J1() {
|
||||
class Q : <!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FIR_IDENTICAL
|
||||
// Error: name should present
|
||||
enum class<!SYNTAX!><!>(val rgb : Int) {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
|
||||
// SKIP_JAVAC
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !LANGUAGE: +InlineClasses, -JvmInlineValueClasses
|
||||
// SKIP_JAVAC
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// SKIP_JAVAC
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// SKIP_JAVAC
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !WITH_NEW_INFERENCE
|
||||
// See KT-6271
|
||||
fun foo() {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !WITH_NEW_INFERENCE
|
||||
// See KT-6271
|
||||
fun foo() {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun foo() {
|
||||
fun bar() = (fun() = bar())
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun foo() {
|
||||
fun bar() = (fun() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!><!DEBUG_INFO_MISSING_UNRESOLVED!>bar<!>()<!>)
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun foo() {
|
||||
fun bar() = {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun foo() {
|
||||
fun bar() = {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun foo() {
|
||||
fun bar1() = bar1()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !WITH_NEW_INFERENCE
|
||||
fun foo() {
|
||||
fun bar1() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!><!DEBUG_INFO_MISSING_UNRESOLVED!>bar1<!>()<!>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// SKIP_JAVAC
|
||||
// FILE: A.java
|
||||
public class A {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// SKIP_JAVAC
|
||||
// FILE: A.java
|
||||
public class A {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FIR_IDENTICAL
|
||||
// FILE: a/b.java
|
||||
package a;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FIR_IDENTICAL
|
||||
// FILE: foo/a/b.java
|
||||
package foo.a;
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FIR_IDENTICAL
|
||||
// FILE: a/b/c.java
|
||||
package a.b;
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FIR_IDENTICAL
|
||||
// FILE: a/b.java
|
||||
package a;
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteOtherErasedDeepTypeArguments.kt
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// WITH_RUNTIME
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: f1.kt
|
||||
package test
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: f1.kt
|
||||
package test
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
fun main(args: Array<String>) {
|
||||
fun f() = run {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
fun main(args: Array<String>) {
|
||||
fun f() = run {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// JAVAC_EXPECTED_FILE
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass<String>): String {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// JAVAC_EXPECTED_FILE
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass<String>): String {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// JAVAC_EXPECTED_FILE
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass): String {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// JAVAC_EXPECTED_FILE
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass): String {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// JAVAC_EXPECTED_FILE
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass<Int>) {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// JAVAC_EXPECTED_FILE
|
||||
// FILE: KotlinFile.kt
|
||||
fun foo(javaClass: JavaClass<Int>) {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !JDK_KIND: MODIFIED_MOCK_JDK
|
||||
abstract class A : Throwable(1.0) {}
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !JDK_KIND: MODIFIED_MOCK_JDK
|
||||
abstract class A : <!DEPRECATION!>Throwable<!>(1.0) {}
|
||||
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !API_VERSION: 1.5
|
||||
// !LANGUAGE: -JvmRecordSupport
|
||||
// SKIP_TXT
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !API_VERSION: 1.5
|
||||
// !LANGUAGE: -JvmRecordSupport
|
||||
// SKIP_TXT
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !API_VERSION: 1.5
|
||||
// !LANGUAGE: +JvmRecordSupport
|
||||
// FILE: MyRecord.java
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !API_VERSION: 1.5
|
||||
// !LANGUAGE: +JvmRecordSupport
|
||||
// FILE: MyRecord.java
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: file1.kt
|
||||
private class C {
|
||||
companion object
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: file1.kt
|
||||
private class <!PACKAGE_OR_CLASSIFIER_REDECLARATION!>C<!> {
|
||||
companion object
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect
|
||||
// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect
|
||||
// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
|
||||
+11
-9
@@ -20,7 +20,6 @@ import org.jetbrains.kotlin.test.MockLibraryUtil
|
||||
import org.jetbrains.kotlin.test.MockLibraryUtil.compileJavaFilesLibraryToJar
|
||||
import org.jetbrains.kotlin.test.TestJavacVersion
|
||||
import org.jetbrains.kotlin.test.TestJdkKind
|
||||
import org.jetbrains.kotlin.test.directives.ForeignAnnotationsDirectives
|
||||
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives
|
||||
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.ALL_JAVA_AS_BINARY
|
||||
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.ASSERTIONS_MODE
|
||||
@@ -46,8 +45,6 @@ import org.jetbrains.kotlin.test.model.DependencyKind
|
||||
import org.jetbrains.kotlin.test.model.TestFile
|
||||
import org.jetbrains.kotlin.test.model.TestModule
|
||||
import org.jetbrains.kotlin.test.services.*
|
||||
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertTrue
|
||||
import org.jetbrains.kotlin.test.services.configuration.JvmForeignAnnotationsConfigurator.Companion.JSR_305_TEST_ANNOTATIONS_PATH
|
||||
import org.jetbrains.kotlin.test.services.jvm.CompiledClassesManager
|
||||
import org.jetbrains.kotlin.test.services.jvm.compiledClassesManager
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
@@ -56,7 +53,6 @@ import org.jetbrains.kotlin.utils.PathUtil
|
||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
import java.io.File
|
||||
import kotlin.io.path.ExperimentalPathApi
|
||||
import kotlin.io.path.createTempDirectory
|
||||
|
||||
class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) {
|
||||
companion object {
|
||||
@@ -100,11 +96,9 @@ class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfig
|
||||
}
|
||||
}
|
||||
|
||||
fun getLibraryFiles(configurationKind: ConfigurationKind, directives: RegisteredDirectives): List<File> {
|
||||
fun getLibraryFilesExceptRealRuntime(configurationKind: ConfigurationKind, directives: RegisteredDirectives): List<File> {
|
||||
val files = mutableListOf<File>()
|
||||
if (configurationKind.withRuntime) {
|
||||
files.add(ForTestCompileRuntime.runtimeJarForTests())
|
||||
files.add(ForTestCompileRuntime.scriptRuntimeJarForTests())
|
||||
files.add(ForTestCompileRuntime.kotlinTestJarForTests())
|
||||
} else if (configurationKind.withMockRuntime) {
|
||||
files.add(ForTestCompileRuntime.minimalRuntimeJarForTests())
|
||||
@@ -118,6 +112,7 @@ class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfig
|
||||
if (JvmEnvironmentConfigurationDirectives.STDLIB_JDK8 in directives) {
|
||||
files.add(ForTestCompileRuntime.runtimeJarForTestsWithJdk8())
|
||||
}
|
||||
files.add(KtTestUtil.getAnnotationsJar())
|
||||
return files
|
||||
}
|
||||
}
|
||||
@@ -185,10 +180,17 @@ class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfig
|
||||
configuration.put(TEST_CONFIGURATION_KIND_KEY, it)
|
||||
}
|
||||
|
||||
configuration.addJvmClasspathRoots(getLibraryFiles(configurationKind, module.directives))
|
||||
val javaVersionToCompile = registeredDirectives[COMPILE_JAVA_USING].singleOrNull()
|
||||
val javaBinaryFiles = if (ALL_JAVA_AS_BINARY !in registeredDirectives) {
|
||||
module.javaFiles.filter { INCLUDE_JAVA_AS_BINARY in it.directives }
|
||||
} else module.javaFiles
|
||||
|
||||
val useJava9ToCompileIncludedJavaFiles = javaVersionToCompile == TestJavacVersion.JAVAC_9
|
||||
|
||||
configuration.addJvmClasspathRoot(KtTestUtil.getAnnotationsJar())
|
||||
if (configurationKind.withRuntime) {
|
||||
configuration.configureStandardLibs(PathUtil.kotlinPathsForDistDirectory, K2JVMCompilerArguments().also { it.noReflect = true })
|
||||
}
|
||||
configuration.addJvmClasspathRoots(getLibraryFilesExceptRealRuntime(configurationKind, module.directives))
|
||||
|
||||
val isIr = module.targetBackend?.isIR == true
|
||||
configuration.put(JVMConfigurationKeys.IR, isIr)
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import java.io.File
|
||||
class FirOldFrontendMetaConfigurator(testServices: TestServices) : MetaTestConfigurator(testServices) {
|
||||
override fun transformTestDataPath(testDataFileName: String): String {
|
||||
val originalFile = File(testDataFileName)
|
||||
val isFirIdentical = originalFile.useLines { it.first() == "// ${FirDiagnosticsDirectives.FIR_IDENTICAL.name}" }
|
||||
val isFirIdentical = originalFile.useLines { lines -> lines.any { it == "// ${FirDiagnosticsDirectives.FIR_IDENTICAL.name}" } }
|
||||
return if (isFirIdentical) {
|
||||
testDataFileName
|
||||
} else {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.test.utils
|
||||
|
||||
import org.jetbrains.kotlin.test.directives.model.Directive
|
||||
import java.io.File
|
||||
|
||||
private const val FIR_KT = ".fir.kt"
|
||||
@@ -44,3 +45,13 @@ fun File.withSuffixAndExtension(suffix: String, extension: String): File {
|
||||
fun File.isDirectiveDefined(directive: String): Boolean = this.useLines { line ->
|
||||
line.any { it == directive }
|
||||
}
|
||||
|
||||
fun File.removeDirectiveFromFile(directive: Directive) {
|
||||
val directiveName = directive.name
|
||||
val directiveRegexp = "^// $directiveName(:.*)?$(\n)?".toRegex(RegexOption.MULTILINE)
|
||||
val text = readText()
|
||||
val directiveRange = directiveRegexp.find(text)?.range
|
||||
?: error("Directive $directiveName was not found in $this")
|
||||
val textWithoutDirective = text.removeRange(directiveRange)
|
||||
writeText(textWithoutDirective)
|
||||
}
|
||||
+9
-1
@@ -13,6 +13,7 @@ import com.intellij.openapi.roots.LanguageLevelProjectExtension
|
||||
import com.intellij.serviceContainer.ComponentManagerImpl
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.MockExternalAnnotationsManager
|
||||
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.idea.caches.project.IdeaModuleInfo
|
||||
import org.jetbrains.kotlin.idea.caches.project.ModuleSourceInfo
|
||||
@@ -181,7 +182,14 @@ abstract class AbstractCompilerBasedTest : KotlinLightCodeInsightFixtureTestCase
|
||||
val configurationKind = JvmEnvironmentConfigurator.extractConfigurationKind(allDirectives)
|
||||
val jdkKind = JvmEnvironmentConfigurator.extractJdkKind(allDirectives)
|
||||
|
||||
val libraryFiles = JvmEnvironmentConfigurator.getLibraryFiles(configurationKind, allDirectives)
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
val libraryFiles = buildList {
|
||||
if (configurationKind.withRuntime) {
|
||||
add(ForTestCompileRuntime.runtimeJarForTests())
|
||||
add(ForTestCompileRuntime.scriptRuntimeJarForTests())
|
||||
}
|
||||
addAll(JvmEnvironmentConfigurator.getLibraryFilesExceptRealRuntime(configurationKind, allDirectives))
|
||||
}
|
||||
|
||||
return object : KotlinJdkAndLibraryProjectDescriptor(libraryFiles) {
|
||||
override fun getSdk(): Sdk = PluginTestCaseBase.jdk(jdkKind)
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* 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.compiler.based
|
||||
|
||||
import org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer
|
||||
import org.jetbrains.kotlin.test.directives.model.DirectiveApplicability.Global
|
||||
|
||||
object FirIdeDirectives : SimpleDirectivesContainer() {
|
||||
val FIR_IDE_IGNORE by directive(
|
||||
description = "Test is ignored in FIR IDE",
|
||||
applicability = Global
|
||||
)
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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.compiler.based
|
||||
|
||||
import org.jetbrains.kotlin.test.model.AfterAnalysisChecker
|
||||
import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
|
||||
import org.jetbrains.kotlin.test.services.moduleStructure
|
||||
import org.jetbrains.kotlin.test.utils.removeDirectiveFromFile
|
||||
|
||||
class IdeTestIgnoreHandler(testServices: TestServices) : AfterAnalysisChecker(testServices) {
|
||||
companion object {
|
||||
private val isTeamCityBuild: Boolean = System.getenv("TEAMCITY_VERSION") != null
|
||||
}
|
||||
|
||||
override val directives: List<DirectivesContainer>
|
||||
get() = listOf(FirIdeDirectives)
|
||||
|
||||
override fun check(failedAssertions: List<Throwable>) {
|
||||
if (!isFirIdeIgnoreDirectivePresent()) return
|
||||
if (failedAssertions.isNotEmpty()) return
|
||||
val moduleStructure = testServices.moduleStructure
|
||||
val testDataFile = testServices.moduleStructure.originalTestDataFiles.first()
|
||||
|
||||
if (!isTeamCityBuild) {
|
||||
testDataFile.removeDirectiveFromFile(FirIdeDirectives.FIR_IDE_IGNORE)
|
||||
}
|
||||
|
||||
val message = if (isTeamCityBuild) {
|
||||
"Please remove // ${FirIdeDirectives.FIR_IDE_IGNORE} from the test source"
|
||||
} else {
|
||||
"Removed // ${FirIdeDirectives.FIR_IDE_IGNORE} from the test source"
|
||||
}
|
||||
throw TestWithFirIdeIgnoreAnnotationPassesException(
|
||||
"""
|
||||
Test pass in FIR IDE
|
||||
$message
|
||||
Please re-run the test now
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
override fun suppressIfNeeded(failedAssertions: List<Throwable>): List<Throwable> {
|
||||
return if (isFirIdeIgnoreDirectivePresent())
|
||||
failedAssertions.filterIsInstance<TestWithFirIdeIgnoreAnnotationPassesException>()
|
||||
else failedAssertions
|
||||
}
|
||||
|
||||
private fun isFirIdeIgnoreDirectivePresent(): Boolean {
|
||||
val moduleStructure = testServices.moduleStructure
|
||||
return FirIdeDirectives.FIR_IDE_IGNORE in moduleStructure.allDirectives
|
||||
}
|
||||
}
|
||||
|
||||
class TestWithFirIdeIgnoreAnnotationPassesException(override val message: String) : IllegalStateException()
|
||||
+4
@@ -8,9 +8,13 @@ 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
|
||||
|
||||
abstract class AbstractDiagnosisCompilerTestDataTest : AbstractCompilerBasedTest() {
|
||||
override fun TestConfigurationBuilder.configureTest() {
|
||||
baseFirDiagnosticTestConfiguration()
|
||||
useAfterAnalysisCheckers(
|
||||
::IdeTestIgnoreHandler
|
||||
)
|
||||
}
|
||||
}
|
||||
+5
@@ -2791,6 +2791,11 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("symbolsAndDescriptors.kt")
|
||||
public void testSymbolsAndDescriptors() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/symbolsAndDescriptors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("transform.kt")
|
||||
public void testTransform() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/transform.kt");
|
||||
|
||||
+177
@@ -4887,6 +4887,133 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SuspendFunctionAsSupertype extends AbstractDiagnosisCompilerTestDataTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSuspendFunctionAsSupertype() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class KSuspendFunctionN extends AbstractDiagnosisCompilerTestDataTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInKSuspendFunctionN() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypes.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperinterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/simple.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Simple extends AbstractDiagnosisCompilerTestDataTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSimple() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypes.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperinterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/simple.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SuspendFunctionN extends AbstractDiagnosisCompilerTestDataTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInSuspendFunctionN() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypes.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperinterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/simple.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/cyclicHierarchy")
|
||||
@@ -10824,6 +10951,11 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/inference/violatingUpperBoundForSelfType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("violatingUpperBoundForSelfTypeError.kt")
|
||||
public void testViolatingUpperBoundForSelfTypeError() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/violatingUpperBoundForSelfTypeError.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/inference/builderInference")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@@ -14569,6 +14701,11 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/abstractBaseClassMemberNotImplemented.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("abstractBaseClassMemberNotImplemented_15.kt")
|
||||
public void testAbstractBaseClassMemberNotImplemented_15() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/abstractBaseClassMemberNotImplemented_15.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("abstractVsAbstract.kt")
|
||||
public void testAbstractVsAbstract() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/abstractVsAbstract.kt");
|
||||
@@ -14593,6 +14730,11 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/implementingMethodOfAny.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt45508.kt")
|
||||
public void testKt45508() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/kt45508.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("notAMethodOfAny.kt")
|
||||
public void testNotAMethodOfAny() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/notAMethodOfAny.kt");
|
||||
@@ -18391,6 +18533,16 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/arrays.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dontSubstituteAnotherErasedRecursiveTypeArgumentAndNonRecursive.kt")
|
||||
public void testDontSubstituteAnotherErasedRecursiveTypeArgumentAndNonRecursive() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/dontSubstituteAnotherErasedRecursiveTypeArgumentAndNonRecursive.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dontSubstituteAnotherErasedTypeArgumentIfRecursive.kt")
|
||||
public void testDontSubstituteAnotherErasedTypeArgumentIfRecursive() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/dontSubstituteAnotherErasedTypeArgumentIfRecursive.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("errorType.kt")
|
||||
public void testErrorType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.kt");
|
||||
@@ -18466,6 +18618,26 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("substituteAnotherErasedTypeArgument.kt")
|
||||
public void testSubstituteAnotherErasedTypeArgument() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteAnotherErasedTypeArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("substituteOtherErasedDeepTypeArguments.kt")
|
||||
public void testSubstituteOtherErasedDeepTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteOtherErasedDeepTypeArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("substituteSeveralOtherErasedDependentTypeArguments.kt")
|
||||
public void testSubstituteSeveralOtherErasedDependentTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteSeveralOtherErasedDependentTypeArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("substituteSeveralOtherErasedTypeArguments.kt")
|
||||
public void testSubstituteSeveralOtherErasedTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteSeveralOtherErasedTypeArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("typeEnhancement.kt")
|
||||
public void testTypeEnhancement() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/typeEnhancement.kt");
|
||||
@@ -25394,6 +25566,11 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/kt42042.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt42042Error.kt")
|
||||
public void testKt42042Error() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/kt42042Error.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt42396.kt")
|
||||
public void testKt42396() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/kt42396.kt");
|
||||
|
||||
Reference in New Issue
Block a user