[Analysis API] do not generate standalone tests which use compiler plugin

This commit is contained in:
Ilya Kirillov
2022-09-20 20:12:23 +02:00
parent 2387b31b9b
commit cd5b9d6356
5 changed files with 33 additions and 92 deletions
@@ -43,7 +43,7 @@ public class FirStandaloneNormalAnalysisSourceModuleResolveCallTestGenerated ext
@Test
public void testAllFilesPresentInResolveCall() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/callResolver/resolveCall"), Pattern.compile("^(.+)\\.kt$"), null, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/callResolver/resolveCall"), Pattern.compile("^(.+)\\.kt$"), null, true, "withTestCompilerPluginEnabled");
}
@Test
@@ -844,7 +844,7 @@ public class FirStandaloneNormalAnalysisSourceModuleResolveCallTestGenerated ext
public class Assignments {
@Test
public void testAllFilesPresentInAssignments() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/callResolver/resolveCall/assignments"), Pattern.compile("^(.+)\\.kt$"), null, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/callResolver/resolveCall/assignments"), Pattern.compile("^(.+)\\.kt$"), null, true, "withTestCompilerPluginEnabled");
}
@Test
@@ -853,26 +853,4 @@ public class FirStandaloneNormalAnalysisSourceModuleResolveCallTestGenerated ext
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/assignments/insidePlusAssignTarget.kt");
}
}
@Nested
@TestMetadata("analysis/analysis-api/testData/components/callResolver/resolveCall/withTestCompilerPluginEnabled")
@TestDataPath("$PROJECT_ROOT")
public class WithTestCompilerPluginEnabled {
@Test
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/callResolver/resolveCall/withTestCompilerPluginEnabled"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("customSerlializable.kt")
public void testCustomSerlializable() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/withTestCompilerPluginEnabled/customSerlializable.kt");
}
@Test
@TestMetadata("dummyFunction.kt")
public void testDummyFunction() throws Exception {
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/withTestCompilerPluginEnabled/dummyFunction.kt");
}
}
}
@@ -43,7 +43,7 @@ public class FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGener
@Test
public void testAllFilesPresentInMemberScopeByFqName() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/scopes/memberScopeByFqName"), Pattern.compile("^(.+)\\.kt$"), null, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/scopes/memberScopeByFqName"), Pattern.compile("^(.+)\\.kt$"), null, true, "withTestCompilerPluginEnabled");
}
@Test
@@ -81,32 +81,4 @@ public class FirStandaloneNormalAnalysisSourceModuleMemberScopeByFqNameTestGener
public void testMutableList() throws Exception {
runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/MutableList.kt");
}
@Nested
@TestMetadata("analysis/analysis-api/testData/scopes/memberScopeByFqName/withTestCompilerPluginEnabled")
@TestDataPath("$PROJECT_ROOT")
public class WithTestCompilerPluginEnabled {
@Test
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/scopes/memberScopeByFqName/withTestCompilerPluginEnabled"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("customSerlializable.kt")
public void testCustomSerlializable() throws Exception {
runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/withTestCompilerPluginEnabled/customSerlializable.kt");
}
@Test
@TestMetadata("generatedCompanionWithFoo.kt")
public void testGeneratedCompanionWithFoo() throws Exception {
runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/withTestCompilerPluginEnabled/generatedCompanionWithFoo.kt");
}
@Test
@TestMetadata("nestedClassAndMaterializeMember.kt")
public void testNestedClassAndMaterializeMember() throws Exception {
runTest("analysis/analysis-api/testData/scopes/memberScopeByFqName/withTestCompilerPluginEnabled/nestedClassAndMaterializeMember.kt");
}
}
}
@@ -43,7 +43,7 @@ public class FirStandaloneNormalAnalysisSourceModuleSymbolByFqNameTestGenerated
@Test
public void testAllFilesPresentInSymbolByFqName() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/symbols/symbolByFqName"), Pattern.compile("^(.+)\\.kt$"), null, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/symbols/symbolByFqName"), Pattern.compile("^(.+)\\.kt$"), null, true, "withTestCompilerPluginEnabled");
}
@Test
@@ -99,20 +99,4 @@ public class FirStandaloneNormalAnalysisSourceModuleSymbolByFqNameTestGenerated
public void testNestedClass() throws Exception {
runTest("analysis/analysis-api/testData/symbols/symbolByFqName/nestedClass.kt");
}
@Nested
@TestMetadata("analysis/analysis-api/testData/symbols/symbolByFqName/withTestCompilerPluginEnabled")
@TestDataPath("$PROJECT_ROOT")
public class WithTestCompilerPluginEnabled {
@Test
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/symbols/symbolByFqName/withTestCompilerPluginEnabled"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("myInterfaceSupertype.kt")
public void testMyInterfaceSupertype() throws Exception {
runTest("analysis/analysis-api/testData/symbols/symbolByFqName/withTestCompilerPluginEnabled/myInterfaceSupertype.kt");
}
}
}
@@ -49,7 +49,7 @@ public class FirStandaloneNormalAnalysisSourceModuleSymbolByReferenceTestGenerat
@Test
public void testAllFilesPresentInSymbolByReference() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/symbols/symbolByReference"), Pattern.compile("^(.+)\\.kt$"), null, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/symbols/symbolByReference"), Pattern.compile("^(.+)\\.kt$"), null, true, "withTestCompilerPluginEnabled");
}
@Test
@@ -87,20 +87,4 @@ public class FirStandaloneNormalAnalysisSourceModuleSymbolByReferenceTestGenerat
public void testSamConstructor() throws Exception {
runTest("analysis/analysis-api/testData/symbols/symbolByReference/samConstructor.kt");
}
@Nested
@TestMetadata("analysis/analysis-api/testData/symbols/symbolByReference/withTestCompilerPluginEnabled")
@TestDataPath("$PROJECT_ROOT")
public class WithTestCompilerPluginEnabled {
@Test
public void testAllFilesPresentInWithTestCompilerPluginEnabled() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/symbols/symbolByReference/withTestCompilerPluginEnabled"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("generatedCompanionWorksAsValue.kt")
public void testGeneratedCompanionWorksAsValue() throws Exception {
runTest("analysis/analysis-api/testData/symbols/symbolByReference/withTestCompilerPluginEnabled/generatedCompanionWorksAsValue.kt");
}
}
}
@@ -88,7 +88,12 @@ private fun AnalysisApiTestGroup.generateAnalysisApiNonComponentsTests() {
AbstractMemberScopeByFqNameTest::class,
filter = frontendIs(FrontendKind.Fir),
) {
model("memberScopeByFqName")
when (it.analysisApiMode) {
AnalysisApiMode.Ide ->
model("memberScopeByFqName")
AnalysisApiMode.Standalone ->
model("memberScopeByFqName", excludeDirsRecursively = listOf("withTestCompilerPluginEnabled"))
}
}
test(AbstractFileScopeTest::class) {
@@ -108,11 +113,21 @@ private fun AnalysisApiTestGroup.generateAnalysisApiNonComponentsTests() {
test(
AbstractSymbolByFqNameTest::class
) {
model("symbolByFqName")
when (it.analysisApiMode) {
AnalysisApiMode.Ide ->
model("symbolByFqName")
AnalysisApiMode.Standalone ->
model("symbolByFqName", excludeDirsRecursively = listOf("withTestCompilerPluginEnabled"))
}
}
test(AbstractSymbolByReferenceTest::class, filter = frontendIs(FrontendKind.Fir)) {
model("symbolByReference")
when (it.analysisApiMode) {
AnalysisApiMode.Ide ->
model("symbolByReference")
AnalysisApiMode.Standalone ->
model("symbolByReference", excludeDirsRecursively = listOf("withTestCompilerPluginEnabled"))
}
}
}
@@ -149,9 +164,17 @@ private fun AnalysisApiTestGroup.generateAnalysisApiNonComponentsTests() {
private fun AnalysisApiTestGroup.generateAnalysisApiComponentsTests() {
component("callResolver", filter = analysisSessionModeIs(AnalysisSessionMode.Normal)) {
test(AbstractResolveCallTest::class) {
model("resolveCall")
group(filter = { it.analysisApiMode == AnalysisApiMode.Standalone }) {
test(AbstractResolveCallTest::class) {
when (it.analysisApiMode) {
AnalysisApiMode.Ide ->
model("resolveCall")
AnalysisApiMode.Standalone ->
model("resolveCall", excludeDirsRecursively = listOf("withTestCompilerPluginEnabled"))
}
}
}
test(
AbstractResolveCandidatesTest::class
) {