Regenerate FIR resolve tests

This commit is contained in:
Mikhail Glukhikh
2018-10-29 11:10:26 +03:00
parent 2bc063b230
commit 631adde3f5
@@ -21,82 +21,79 @@ import java.util.regex.Pattern;
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase { public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInResolve() throws Exception { public void testAllFilesPresentInResolve() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/fir/resolve"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/fir/resolve"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true);
} }
@TestMetadata("enum.kt") @TestMetadata("enum.kt")
public void testEnum() throws Exception { public void testEnum() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/enum.kt"); runTest("compiler/testData/fir/resolve/enum.kt");
doTest(fileName);
} }
@TestMetadata("F.kt") @TestMetadata("F.kt")
public void testF() throws Exception { public void testF() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/F.kt"); runTest("compiler/testData/fir/resolve/F.kt");
doTest(fileName);
} }
@TestMetadata("genericFunctions.kt") @TestMetadata("genericFunctions.kt")
public void testGenericFunctions() throws Exception { public void testGenericFunctions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/genericFunctions.kt"); runTest("compiler/testData/fir/resolve/genericFunctions.kt");
doTest(fileName);
} }
@TestMetadata("NestedOfAliasedType.kt") @TestMetadata("NestedOfAliasedType.kt")
public void testNestedOfAliasedType() throws Exception { public void testNestedOfAliasedType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/NestedOfAliasedType.kt"); runTest("compiler/testData/fir/resolve/NestedOfAliasedType.kt");
doTest(fileName);
} }
@TestMetadata("NestedSuperType.kt") @TestMetadata("NestedSuperType.kt")
public void testNestedSuperType() throws Exception { public void testNestedSuperType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/NestedSuperType.kt"); runTest("compiler/testData/fir/resolve/NestedSuperType.kt");
doTest(fileName);
} }
@TestMetadata("simpleClass.kt") @TestMetadata("simpleClass.kt")
public void testSimpleClass() throws Exception { public void testSimpleClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/simpleClass.kt"); runTest("compiler/testData/fir/resolve/simpleClass.kt");
doTest(fileName);
} }
@TestMetadata("simpleTypeAlias.kt") @TestMetadata("simpleTypeAlias.kt")
public void testSimpleTypeAlias() throws Exception { public void testSimpleTypeAlias() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/simpleTypeAlias.kt"); runTest("compiler/testData/fir/resolve/simpleTypeAlias.kt");
doTest(fileName);
} }
@TestMetadata("TwoDeclarationsInSameFile.kt") @TestMetadata("TwoDeclarationsInSameFile.kt")
public void testTwoDeclarationsInSameFile() throws Exception { public void testTwoDeclarationsInSameFile() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/TwoDeclarationsInSameFile.kt"); runTest("compiler/testData/fir/resolve/TwoDeclarationsInSameFile.kt");
doTest(fileName);
} }
@TestMetadata("typeAliasWithGeneric.kt") @TestMetadata("typeAliasWithGeneric.kt")
public void testTypeAliasWithGeneric() throws Exception { public void testTypeAliasWithGeneric() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/typeAliasWithGeneric.kt"); runTest("compiler/testData/fir/resolve/typeAliasWithGeneric.kt");
doTest(fileName);
} }
@TestMetadata("typeParameterVsNested.kt") @TestMetadata("typeParameterVsNested.kt")
public void testTypeParameterVsNested() throws Exception { public void testTypeParameterVsNested() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/typeParameterVsNested.kt"); runTest("compiler/testData/fir/resolve/typeParameterVsNested.kt");
doTest(fileName);
} }
@TestMetadata("compiler/testData/fir/resolve/builtins") @TestMetadata("compiler/testData/fir/resolve/builtins")
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
public static class Builtins extends AbstractFirResolveTestCase { public static class Builtins extends AbstractFirResolveTestCase {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInBuiltins() throws Exception { public void testAllFilesPresentInBuiltins() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/fir/resolve/builtins"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/fir/resolve/builtins"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true);
} }
@TestMetadata("lists.kt") @TestMetadata("lists.kt")
public void testLists() throws Exception { public void testLists() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/builtins/lists.kt"); runTest("compiler/testData/fir/resolve/builtins/lists.kt");
doTest(fileName);
} }
} }
@@ -104,56 +101,52 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
@TestDataPath("$PROJECT_ROOT") @TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class) @RunWith(JUnit3RunnerWithInners.class)
public static class Multifile extends AbstractFirResolveTestCase { public static class Multifile extends AbstractFirResolveTestCase {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInMultifile() throws Exception { public void testAllFilesPresentInMultifile() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/fir/resolve/multifile"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true); KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/fir/resolve/multifile"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true);
} }
@TestMetadata("NestedSuperType.kt") @TestMetadata("NestedSuperType.kt")
public void testNestedSuperType() throws Exception { public void testNestedSuperType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/multifile/NestedSuperType.kt"); runTest("compiler/testData/fir/resolve/multifile/NestedSuperType.kt");
doTest(fileName);
} }
@TestMetadata("sealedStarImport.kt") @TestMetadata("sealedStarImport.kt")
public void testSealedStarImport() throws Exception { public void testSealedStarImport() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/multifile/sealedStarImport.kt"); runTest("compiler/testData/fir/resolve/multifile/sealedStarImport.kt");
doTest(fileName);
} }
@TestMetadata("simpleAliasedImport.kt") @TestMetadata("simpleAliasedImport.kt")
public void testSimpleAliasedImport() throws Exception { public void testSimpleAliasedImport() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/multifile/simpleAliasedImport.kt"); runTest("compiler/testData/fir/resolve/multifile/simpleAliasedImport.kt");
doTest(fileName);
} }
@TestMetadata("simpleImport.kt") @TestMetadata("simpleImport.kt")
public void testSimpleImport() throws Exception { public void testSimpleImport() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/multifile/simpleImport.kt"); runTest("compiler/testData/fir/resolve/multifile/simpleImport.kt");
doTest(fileName);
} }
@TestMetadata("simpleImportNested.kt") @TestMetadata("simpleImportNested.kt")
public void testSimpleImportNested() throws Exception { public void testSimpleImportNested() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/multifile/simpleImportNested.kt"); runTest("compiler/testData/fir/resolve/multifile/simpleImportNested.kt");
doTest(fileName);
} }
@TestMetadata("simpleImportOuter.kt") @TestMetadata("simpleImportOuter.kt")
public void testSimpleImportOuter() throws Exception { public void testSimpleImportOuter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/multifile/simpleImportOuter.kt"); runTest("compiler/testData/fir/resolve/multifile/simpleImportOuter.kt");
doTest(fileName);
} }
@TestMetadata("simpleStarImport.kt") @TestMetadata("simpleStarImport.kt")
public void testSimpleStarImport() throws Exception { public void testSimpleStarImport() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/multifile/simpleStarImport.kt"); runTest("compiler/testData/fir/resolve/multifile/simpleStarImport.kt");
doTest(fileName);
} }
@TestMetadata("TypeAliasExpansion.kt") @TestMetadata("TypeAliasExpansion.kt")
public void testTypeAliasExpansion() throws Exception { public void testTypeAliasExpansion() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/fir/resolve/multifile/TypeAliasExpansion.kt"); runTest("compiler/testData/fir/resolve/multifile/TypeAliasExpansion.kt");
doTest(fileName);
} }
} }
} }