[Jspecify] Move jspecify test runner under the new tests infrastructure

This commit is contained in:
Victor Petukhov
2021-04-05 17:59:03 +03:00
parent 6f9694174f
commit 8f097b14cc
8 changed files with 182 additions and 339 deletions
@@ -1,157 +0,0 @@
/*
* 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.checkers;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.runner.RunWith;
import java.io.File;
import java.util.regex.Pattern;
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class JspecifyAnnotationsTestGenerated extends AbstractJspecifyAnnotationsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInKotlin() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class StrictMode extends AbstractJspecifyAnnotationsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInStrictMode() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("AnnotatedBoundsOfWildcard.kt")
public void testAnnotatedBoundsOfWildcard() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/AnnotatedBoundsOfWildcard.kt");
}
@TestMetadata("Defaults.kt")
public void testDefaults() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Defaults.kt");
}
@TestMetadata("IgnoreAnnotations.kt")
public void testIgnoreAnnotations() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/IgnoreAnnotations.kt");
}
@TestMetadata("NonPlatformTypeParameter.kt")
public void testNonPlatformTypeParameter() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NonPlatformTypeParameter.kt");
}
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/NullnessUnspecifiedTypeParameter.kt");
}
@TestMetadata("SelfType.kt")
public void testSelfType() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/SelfType.kt");
}
@TestMetadata("Simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/Simple.kt");
}
@TestMetadata("TypeArgumentsFromParameterBounds.kt")
public void testTypeArgumentsFromParameterBounds() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeArgumentsFromParameterBounds.kt");
}
@TestMetadata("TypeParameterBounds.kt")
public void testTypeParameterBounds() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/TypeParameterBounds.kt");
}
@TestMetadata("WildcardsWithDefault.kt")
public void testWildcardsWithDefault() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/strictMode/WildcardsWithDefault.kt");
}
}
@TestMetadata("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class WarnMode extends AbstractJspecifyAnnotationsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInWarnMode() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("AnnotatedBoundsOfWildcard.kt")
public void testAnnotatedBoundsOfWildcard() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/AnnotatedBoundsOfWildcard.kt");
}
@TestMetadata("Defaults.kt")
public void testDefaults() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Defaults.kt");
}
@TestMetadata("IgnoreAnnotations.kt")
public void testIgnoreAnnotations() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/IgnoreAnnotations.kt");
}
@TestMetadata("NonPlatformTypeParameter.kt")
public void testNonPlatformTypeParameter() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NonPlatformTypeParameter.kt");
}
@TestMetadata("NullnessUnspecifiedTypeParameter.kt")
public void testNullnessUnspecifiedTypeParameter() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/NullnessUnspecifiedTypeParameter.kt");
}
@TestMetadata("SelfType.kt")
public void testSelfType() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/SelfType.kt");
}
@TestMetadata("Simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/Simple.kt");
}
@TestMetadata("TypeArgumentsFromParameterBounds.kt")
public void testTypeArgumentsFromParameterBounds() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeArgumentsFromParameterBounds.kt");
}
@TestMetadata("TypeParameterBounds.kt")
public void testTypeParameterBounds() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/TypeParameterBounds.kt");
}
@TestMetadata("WildcardsWithDefault.kt")
public void testWildcardsWithDefault() throws Exception {
runTest("compiler/testData/foreignAnnotations/java8Tests/jspecify/kotlin/warnMode/WildcardsWithDefault.kt");
}
}
}
@@ -28,10 +28,6 @@ fun main(args: Array<String>) {
generateTestGroupSuite(args) {
testGroup("compiler/tests-java8/tests", "compiler/testData") {
testClass<AbstractJspecifyAnnotationsTest> {
model("foreignAnnotations/java8Tests/jspecify/kotlin")
}
testClass<AbstractForeignAnnotationsCompiledJavaDiagnosticTest> {
model("foreignAnnotations/java8Tests/typeEnhancementOnCompiledJava")
}