[test] Use custom ignore directive for AbstractKlibJsTextTestCase tests

We've muted some irText tests on JS in the previous commits because
test expectations in some tests are different when targeting JS.

AbstractKlibJsTextTestCase tests use a different logic:
they compare the dump of the deserialized IR with the frontend-generated
IR, not with the expectations in text files, thus muted tests weren't
actually failing.

Here we introduce a temporary fix, namely
a separate // IGNORE directive for klib tests.

When klib tests are moved to the new test infrastructure, there will be
no need to do this.
This commit is contained in:
Sergej Jaskiewicz
2023-03-21 19:29:44 +01:00
committed by Space Team
parent 27ccef868a
commit 88b7f30867
8 changed files with 62 additions and 49 deletions
@@ -23,7 +23,7 @@ import java.util.regex.Pattern;
@RunWith(JUnit3RunnerWithInners.class)
public class KlibJsIrTextTestCaseGenerated extends AbstractKlibJsIrTextTestCase {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JS_IR, testDataFilePath);
KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JS_IR, testDataFilePath, "// IGNORE_BACKEND_KLIB: ");
}
public void testAllFilesPresentInJs() throws Exception {
@@ -35,7 +35,7 @@ public class KlibJsIrTextTestCaseGenerated extends AbstractKlibJsIrTextTestCase
@RunWith(JUnit3RunnerWithInners.class)
public static class Dynamic extends AbstractKlibJsIrTextTestCase {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JS_IR, testDataFilePath);
KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JS_IR, testDataFilePath, "// IGNORE_BACKEND_KLIB: ");
}
public void testAllFilesPresentInDynamic() throws Exception {
@@ -158,7 +158,7 @@ public class KlibJsIrTextTestCaseGenerated extends AbstractKlibJsIrTextTestCase
@RunWith(JUnit3RunnerWithInners.class)
public static class External extends AbstractKlibJsIrTextTestCase {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JS_IR, testDataFilePath);
KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JS_IR, testDataFilePath, "// IGNORE_BACKEND_KLIB: ");
}
public void testAllFilesPresentInExternal() throws Exception {
@@ -176,7 +176,7 @@ public class KlibJsIrTextTestCaseGenerated extends AbstractKlibJsIrTextTestCase
@RunWith(JUnit3RunnerWithInners.class)
public static class Native extends AbstractKlibJsIrTextTestCase {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JS_IR, testDataFilePath);
KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JS_IR, testDataFilePath, "// IGNORE_BACKEND_KLIB: ");
}
public void testAllFilesPresentInNative() throws Exception {