Minor, move wrongAnnotationArgumentInCtor.kt to CLI tests

The fact that this was a codegen box test was probably an abuse of the
testing infrastructure. It was never meant to pass, since it checks
presence of an error, and diagnostic tests aren't enough since they
might not check the full compiler execution.
This commit is contained in:
Alexander Udalov
2020-02-12 14:21:55 +01:00
parent 9c9e13d93e
commit d5987fd7f3
11 changed files with 23 additions and 50 deletions
@@ -0,0 +1,3 @@
$TESTDATA_DIR$/wrongAnnotationArgumentInCtor.kt
-d
$TEMP_DIR$
@@ -0,0 +1,11 @@
@Target(AnnotationTarget.FIELD, AnnotationTarget.CLASS)
annotation class Anno
class UnresolvedArgument(@Anno(BLA) val s: Int)
class WithoutArguments(@Deprecated val s: Int)
fun test() {
UnresolvedArgument(3)
WithoutArguments(0)
}
@@ -0,0 +1,4 @@
compiler/testData/cli/jvm/wrongAnnotationArgumentInCtor.kt:6:25: error: no value passed for parameter 'message'
class WithoutArguments(@Deprecated val s: Int)
^
COMPILATION_ERROR
@@ -1,20 +0,0 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JVM, JS, NATIVE
// Here we check that there is compilation error, so ignore_backend directive is actual
@Target(AnnotationTarget.FIELD, AnnotationTarget.CLASS)
annotation class Anno
class UnresolvedArgument(@Anno(BLA) val s: Int)
class WithoutArguments(@Deprecated val s: Int)
fun box(): String {
UnresolvedArgument(3)
WithoutArguments(0)
return "OK"
}
@@ -735,6 +735,11 @@ public class CliTestGenerated extends AbstractCliTest {
runTest("compiler/testData/cli/jvm/wrongAbiVersion.args");
}
@TestMetadata("wrongAnnotationArgumentInCtor.args")
public void testWrongAnnotationArgumentInCtor() throws Exception {
runTest("compiler/testData/cli/jvm/wrongAnnotationArgumentInCtor.args");
}
@TestMetadata("wrongArgument.args")
public void testWrongArgument() throws Exception {
runTest("compiler/testData/cli/jvm/wrongArgument.args");
@@ -216,11 +216,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/annotations/varargInAnnotationParameter.kt");
}
@TestMetadata("wrongAnnotationArgumentInCtor.kt")
public void testWrongAnnotationArgumentInCtor() throws Exception {
runTest("compiler/testData/codegen/box/annotations/wrongAnnotationArgumentInCtor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -33,11 +33,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Annotations extends AbstractLightAnalysisModeTest {
@TestMetadata("wrongAnnotationArgumentInCtor.kt")
public void ignoreWrongAnnotationArgumentInCtor() throws Exception {
runTest("compiler/testData/codegen/box/annotations/wrongAnnotationArgumentInCtor.kt");
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
@@ -216,11 +216,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/annotations/varargInAnnotationParameter.kt");
}
@TestMetadata("wrongAnnotationArgumentInCtor.kt")
public void testWrongAnnotationArgumentInCtor() throws Exception {
runTest("compiler/testData/codegen/box/annotations/wrongAnnotationArgumentInCtor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -216,11 +216,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/annotations/varargInAnnotationParameter.kt");
}
@TestMetadata("wrongAnnotationArgumentInCtor.kt")
public void testWrongAnnotationArgumentInCtor() throws Exception {
runTest("compiler/testData/codegen/box/annotations/wrongAnnotationArgumentInCtor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -61,11 +61,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
}
@TestMetadata("wrongAnnotationArgumentInCtor.kt")
public void testWrongAnnotationArgumentInCtor() throws Exception {
runTest("compiler/testData/codegen/box/annotations/wrongAnnotationArgumentInCtor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -61,11 +61,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
}
@TestMetadata("wrongAnnotationArgumentInCtor.kt")
public void testWrongAnnotationArgumentInCtor() throws Exception {
runTest("compiler/testData/codegen/box/annotations/wrongAnnotationArgumentInCtor.kt");
}
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)