From 09c27d78b8edcfe064ac2a206b4452d4671d2251 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 13 Mar 2024 16:23:04 +0200 Subject: [PATCH] [Test] Revert not-needed change in KotlinTestUtils The corresponding test was incorrectly muted in c818ce92 --- compiler/testData/codegen/box/klib/kt33411.kt | 3 +-- .../org/jetbrains/kotlin/test/KotlinTestUtils.java | 14 +++----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/compiler/testData/codegen/box/klib/kt33411.kt b/compiler/testData/codegen/box/klib/kt33411.kt index aacd2113da4..0edcd49f454 100644 --- a/compiler/testData/codegen/box/klib/kt33411.kt +++ b/compiler/testData/codegen/box/klib/kt33411.kt @@ -1,8 +1,7 @@ // IGNORE_NATIVE: cacheMode=STATIC_EVERYWHERE && target=linux_x64 // IGNORE_NATIVE: cacheMode=STATIC_PER_FILE_EVERYWHERE && target=linux_x64 // IGNORE_BACKEND_K1: JVM, JVM_IR -// DONT_CHECK_IGNORED -// LightAnalysisModeTestGenerated passes because it doesn't compile the body of function `box` actually +// IGNORE_LIGHT_ANALYSIS // ISSUE: KT-33411, KT-66338 diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java b/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java index b0babee2277..82be53d66c6 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java @@ -63,7 +63,8 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static org.jetbrains.kotlin.test.InTextDirectivesUtils.*; +import static org.jetbrains.kotlin.test.InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIXES; +import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isIgnoredTarget; public class KotlinTestUtils { public static String TEST_MODULE_NAME = "test-module"; @@ -82,13 +83,6 @@ public class KotlinTestUtils { private static final Pattern DIRECTIVE_PATTERN = Pattern.compile("^//\\s*[!]?([A-Z_0-9]+)(:[ \\t]*(.*))?$", Pattern.MULTILINE); - /** - * This directive removes checks if ignored test actually passes or not - * It is very hacky and supposed to be use only in cases when some test passes in one configuration and fails in the other, - * and both those configurations share the same ignore directive - */ - private static final String DONT_CHECK_IGNORED = "DONT_CHECK_IGNORED"; - private KotlinTestUtils() { } @@ -577,9 +571,7 @@ public class KotlinTestUtils { return; } - boolean dontCheckIgnored = InTextDirectivesUtils.isDirectiveDefined(textWithDirectives(testDataFile), DONT_CHECK_IGNORED); - - if (isIgnored && !dontCheckIgnored) { + if (isIgnored) { StringBuilder directivesToRemove = new StringBuilder(); if (AUTOMATICALLY_UNMUTE_PASSED_TESTS) { for (String ignoreDirective: ignoreDirectives){