[TEST] Generate new tests using new runners and old testdata

This commit is contained in:
Dmitriy Novozhilov
2020-12-02 17:25:30 +03:00
parent d7224ad63e
commit 6128d5e7f2
6 changed files with 107489 additions and 33 deletions
@@ -17110,16 +17110,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
runTest("compiler/testData/diagnostics/tests/platformTypes/elvis.kt");
}
@TestMetadata("explicitFlexibleNoPackage.kt")
public void testExplicitFlexibleNoPackage() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/explicitFlexibleNoPackage.kt");
}
@TestMetadata("explicitFlexibleWithPackage.kt")
public void testExplicitFlexibleWithPackage() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/explicitFlexibleWithPackage.kt");
}
@TestMetadata("getParentOfType.kt")
public void testGetParentOfType() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/getParentOfType.kt");
@@ -17185,11 +17175,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
runTest("compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt");
}
@TestMetadata("supertypeArgumentsExplicit.kt")
public void testSupertypeArgumentsExplicit() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/supertypeArgumentsExplicit.kt");
}
@TestMetadata("supertypeTypeArguments.kt")
public void testSupertypeTypeArguments() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/supertypeTypeArguments.kt");
@@ -17301,24 +17286,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
}
}
@TestMetadata("compiler/testData/diagnostics/tests/platformTypes/intersection")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Intersection extends AbstractFirOldFrontendDiagnosticsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInIntersection() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/platformTypes/intersection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("map.kt")
public void testMap() throws Exception {
runTest("compiler/testData/diagnostics/tests/platformTypes/intersection/map.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/platformTypes/methodCall")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -0,0 +1,39 @@
/*
* Copyright 2010-2020 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.test.generators
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil
import org.jetbrains.kotlin.test.runners.*
fun main(args: Array<String>) {
val excludedFirTestdataPattern = "^(.+)\\.fir\\.kts?\$"
generateNewTestGroupSuite(args) {
testGroup("compiler/tests-common-new/tests-gen", "compiler/testData") {
testClass<AbstractDiagnosticTest> {
model("diagnostics/tests", pattern = "^(.*)\\.kts?$", excludedPattern = excludedFirTestdataPattern)
model("diagnostics/testsWithStdLib", excludedPattern = excludedFirTestdataPattern)
}
testClass<AbstractDiagnosticUsingJavacTest> {
model("diagnostics/tests", pattern = "^(.*)\\.kts?$", excludedPattern = excludedFirTestdataPattern)
model("diagnostics/testsWithStdLib", excludedPattern = excludedFirTestdataPattern)
}
testClass<AbstractFirDiagnosticTest>(suiteTestClassName = "FirOldFrontendDiagnosticsTestGenerated") {
model("diagnostics/tests", excludedPattern = excludedFirTestdataPattern)
model("diagnostics/testsWithStdLib", excludedPattern = excludedFirTestdataPattern)
}
}
testGroup("compiler/tests-common-new/tests-gen", "compiler/fir/analysis-tests/testData") {
testClass<AbstractFirDiagnosticTest> {
model("resolve", pattern = TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME)
model("resolveWithStdlib", pattern = TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME)
}
}
}
}