Reorganize diagnostics tests with stdlib and reflect

DiagnosticsTestWithStdLib now require stdlib only.
Move test data accordingly.
The only test that required kotlin-reflect is transformed into
codegen box test.
This commit is contained in:
Ilya Gorbunov
2019-12-25 22:14:12 +03:00
parent ec6fdc5d4d
commit ac790bea71
19 changed files with 54 additions and 93 deletions
@@ -9,6 +9,6 @@ import org.jetbrains.kotlin.test.ConfigurationKind
abstract class AbstractFirOldFrontendDiagnosticsTestWithStdlib : AbstractFirOldFrontendDiagnosticsTest() {
override fun getConfigurationKind(): ConfigurationKind {
return ConfigurationKind.ALL
return ConfigurationKind.NO_KOTLIN_REFLECT
}
}
@@ -17273,24 +17273,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
}
}
@TestMetadata("compiler/testData/diagnostics/tests/reflection")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Reflection extends AbstractFirOldFrontendDiagnosticsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInReflection() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("noReflectionInClassPath.kt")
public void testNoReflectionInClassPath() throws Exception {
runTest("compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/regressions")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -2296,6 +2296,11 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("noReflectionInClassPath.kt")
public void testNoReflectionInClassPath() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt");
}
@TestMetadata("typeOfWithNonReifiedParameter.kt")
public void testTypeOfWithNonReifiedParameter() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/typeOfWithNonReifiedParameter.kt");
@@ -2359,11 +2364,6 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi
runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt");
}
@TestMetadata("kt9345.kt")
public void testKt9345() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt");
}
@TestMetadata("kt9820_javaFunctionTypeInheritor.kt")
public void testKt9820_javaFunctionTypeInheritor() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt");
+15
View File
@@ -0,0 +1,15 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_REFLECT
// KT-9345 Type inference failure
fun Class<*>.foo(): Any? = kotlin.objectInstance
object OK {
override fun toString(): String = "OK"
}
fun box(): String {
return OK::class.java.foo().toString()
}
@@ -1,3 +0,0 @@
//KT-9345 Type inference failure
fun Class<*>.foo(): Any? = kotlin.<!UNRESOLVED_REFERENCE!>objectInstance<!>
@@ -1,3 +0,0 @@
//KT-9345 Type inference failure
fun Class<*>.foo(): Any? = kotlin.objectInstance
@@ -1,3 +0,0 @@
package
public fun java.lang.Class<*>.foo(): kotlin.Any?
@@ -1,17 +1,6 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2010-2019 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;
@@ -23,6 +12,6 @@ public abstract class AbstractDiagnosticsTestWithStdLib extends AbstractDiagnost
@NotNull
@Override
protected ConfigurationKind getConfigurationKind() {
return ConfigurationKind.ALL;
return ConfigurationKind.NO_KOTLIN_REFLECT;
}
}
@@ -17285,24 +17285,6 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
}
}
@TestMetadata("compiler/testData/diagnostics/tests/reflection")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Reflection extends AbstractDiagnosticsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInReflection() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/reflection"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("noReflectionInClassPath.kt")
public void testNoReflectionInClassPath() throws Exception {
runTest("compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/regressions")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -3231,6 +3231,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("noReflectionInClassPath.kt")
public void testNoReflectionInClassPath() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt");
}
@TestMetadata("typeOfWithNonReifiedParameter.kt")
public void testTypeOfWithNonReifiedParameter() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/typeOfWithNonReifiedParameter.kt");
@@ -3294,11 +3299,6 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt");
}
@TestMetadata("kt9345.kt")
public void testKt9345() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt");
}
@TestMetadata("kt9820_javaFunctionTypeInheritor.kt")
public void testKt9820_javaFunctionTypeInheritor() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt");
@@ -3231,6 +3231,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("noReflectionInClassPath.kt")
public void testNoReflectionInClassPath() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/noReflectionInClassPath.kt");
}
@TestMetadata("typeOfWithNonReifiedParameter.kt")
public void testTypeOfWithNonReifiedParameter() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/reflection/typeOfWithNonReifiedParameter.kt");
@@ -3294,11 +3299,6 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt");
}
@TestMetadata("kt9345.kt")
public void testKt9345() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt");
}
@TestMetadata("kt9820_javaFunctionTypeInheritor.kt")
public void testKt9820_javaFunctionTypeInheritor() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt");
@@ -17275,24 +17275,6 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
}
}
@TestMetadata("compiler/testData/diagnostics/tests/reflection")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Reflection extends AbstractDiagnosticsUsingJavacTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInReflection() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/reflection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("noReflectionInClassPath.kt")
public void testNoReflectionInClassPath() throws Exception {
runTest("compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/regressions")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -25948,6 +25948,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/regressions/kt864.kt");
}
@TestMetadata("kt9345.kt")
public void testKt9345() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt9345.kt");
}
@TestMetadata("kt998.kt")
public void testKt998() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt998.kt");
@@ -24765,6 +24765,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/regressions/kt864.kt");
}
@TestMetadata("kt9345.kt")
public void testKt9345() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt9345.kt");
}
@TestMetadata("kt998.kt")
public void testKt998() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt998.kt");
@@ -24447,6 +24447,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/regressions/kt864.kt");
}
@TestMetadata("kt9345.kt")
public void testKt9345() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt9345.kt");
}
@TestMetadata("kt998.kt")
public void testKt998() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt998.kt");
@@ -24447,6 +24447,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/regressions/kt864.kt");
}
@TestMetadata("kt9345.kt")
public void testKt9345() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt9345.kt");
}
@TestMetadata("kt998.kt")
public void testKt998() throws Exception {
runTest("compiler/testData/codegen/box/regressions/kt998.kt");