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)
|
||||
}
|
||||
Reference in New Issue
Block a user