From 2dfaa819959eb0e570c0774d8cc75c01980c3c24 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Tue, 17 Sep 2013 19:28:43 +0400 Subject: [PATCH] Tests for 'suppress' annotation --- .../resolve/DiagnosticsWithSuppression.java | 4 +- .../allWarnings/suppressWarningsOnClass.kt | 7 + .../suppressWarningsOnClassObject.kt | 6 + .../allWarnings/suppressWarningsOnFunction.kt | 4 + .../allWarnings/suppressWarningsOnObject.kt | 4 + .../suppressWarningsOnParameter.kt | 3 + .../allWarnings/suppressWarningsOnProperty.kt | 4 + .../suppressWarningsOnPropertyAccessor.kt | 5 + .../tests/suppress/manyWarnings/mixed.kt | 5 + .../tests/suppress/manyWarnings/onClass.kt | 4 + .../suppress/manyWarnings/onClassObject.kt | 6 + .../tests/suppress/manyWarnings/onFunction.kt | 4 + .../tests/suppress/manyWarnings/onObject.kt | 4 + .../suppress/manyWarnings/onParameter.kt | 3 + .../tests/suppress/manyWarnings/onProperty.kt | 4 + .../manyWarnings/onPropertyAccessor.kt | 5 + .../tests/suppress/oneWarning/onClass.kt | 4 + .../suppress/oneWarning/onClassObject.kt | 6 + .../tests/suppress/oneWarning/onFunction.kt | 4 + .../suppress/oneWarning/onLocalVariable.kt | 7 + .../tests/suppress/oneWarning/onObject.kt | 4 + .../tests/suppress/oneWarning/onParameter.kt | 3 + .../tests/suppress/oneWarning/onProperty.kt | 4 + .../suppress/oneWarning/onPropertyAccessor.kt | 5 + .../checkers/JetDiagnosticsTestGenerated.java | 159 +++++++++++++++++- 25 files changed, 265 insertions(+), 3 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClass.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/manyWarnings/mixed.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/manyWarnings/onClass.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/manyWarnings/onClassObject.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/manyWarnings/onFunction.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/manyWarnings/onObject.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/manyWarnings/onParameter.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/manyWarnings/onProperty.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/manyWarnings/onPropertyAccessor.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/onClass.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/onClassObject.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/onFunction.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/onLocalVariable.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/onObject.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/onParameter.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/onProperty.kt create mode 100644 compiler/testData/diagnostics/tests/suppress/oneWarning/onPropertyAccessor.kt diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DiagnosticsWithSuppression.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DiagnosticsWithSuppression.java index 5a42063c3fb..8dd7653ecc1 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DiagnosticsWithSuppression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DiagnosticsWithSuppression.java @@ -47,7 +47,7 @@ public class DiagnosticsWithSuppression implements Diagnostics { return ContainerUtil.filter(diagnostics, new Condition() { @Override public boolean value(Diagnostic diagnostic) { - return isSuppressed(diagnostic); + return !isSuppressed(diagnostic); } }); } @@ -100,7 +100,7 @@ public class DiagnosticsWithSuppression implements Diagnostics { List> values = arrayValue.getValue(); if (isSuppressedByStrings(diagnostic, strings(values))) { - + return true; } } diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClass.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClass.kt new file mode 100644 index 00000000000..02f0cb13797 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClass.kt @@ -0,0 +1,7 @@ +suppress("warnings") +class C { + fun foo(p: String??) { + // Make sure errors are not suppressed: + p = "" + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.kt new file mode 100644 index 00000000000..c0660e34d7e --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.kt @@ -0,0 +1,6 @@ +class C { + suppress("warnings") + class object { + val foo: String?? = null as Nothing? + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt new file mode 100644 index 00000000000..ea54e6a0478 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt @@ -0,0 +1,4 @@ +class C { + suppress("warnings") + fun foo(p: String??) {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.kt new file mode 100644 index 00000000000..cc6afb99b9b --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.kt @@ -0,0 +1,4 @@ +suppress("warnings") +object C { + fun foo(p: String??) {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.kt new file mode 100644 index 00000000000..d1ff4a55e66 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.kt @@ -0,0 +1,3 @@ +class C { + fun foo(suppress("warnings") p: String?? = "" as String) {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.kt new file mode 100644 index 00000000000..af332512e7f --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.kt @@ -0,0 +1,4 @@ +class C { + suppress("warnings") + val foo: String?? = null as Nothing? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt new file mode 100644 index 00000000000..8a34209758d --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt @@ -0,0 +1,5 @@ +class C { + val foo: String? + [suppress("warnings")] + get(): String?? = null as Nothing? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/mixed.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/mixed.kt new file mode 100644 index 00000000000..96534d2ab02 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/mixed.kt @@ -0,0 +1,5 @@ +suppress("REDUNDANT_NULLABLE") +class C { + suppress("UNNECESSARY_NOT_NULL_ASSERTION") + fun foo(): String?? = ""!! as String?? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onClass.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onClass.kt new file mode 100644 index 00000000000..d303b6ca905 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onClass.kt @@ -0,0 +1,4 @@ +suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") +class C { + fun foo(): String?? = ""!! as String?? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onClassObject.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onClassObject.kt new file mode 100644 index 00000000000..a3b1a583be1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onClassObject.kt @@ -0,0 +1,6 @@ +class C { + suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") + class object { + val foo: String?? = ""!! as String?? + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onFunction.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onFunction.kt new file mode 100644 index 00000000000..78c97cb932a --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onFunction.kt @@ -0,0 +1,4 @@ +class C { + suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") + fun foo(): String?? = ""!! as String?? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onObject.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onObject.kt new file mode 100644 index 00000000000..7335b7c1b2d --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onObject.kt @@ -0,0 +1,4 @@ +suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") +object C { + fun foo(): String?? = ""!! as String?? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onParameter.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onParameter.kt new file mode 100644 index 00000000000..eba1a988f96 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onParameter.kt @@ -0,0 +1,3 @@ +class C { + fun foo(suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") p: String?? = ""!! as String??) = p +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onProperty.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onProperty.kt new file mode 100644 index 00000000000..13340a896d7 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onProperty.kt @@ -0,0 +1,4 @@ +class C { + suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION") + val foo: String?? = ""!! as String?? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/manyWarnings/onPropertyAccessor.kt b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onPropertyAccessor.kt new file mode 100644 index 00000000000..3524ef0d9d7 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/manyWarnings/onPropertyAccessor.kt @@ -0,0 +1,5 @@ +class C { + val foo: String? + [suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")] + get(): String?? = ""!! as String?? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onClass.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onClass.kt new file mode 100644 index 00000000000..2d9e2827205 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onClass.kt @@ -0,0 +1,4 @@ +suppress("REDUNDANT_NULLABLE") +class C { + fun foo(): String?? = null as Nothing?? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onClassObject.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onClassObject.kt new file mode 100644 index 00000000000..22981944670 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onClassObject.kt @@ -0,0 +1,6 @@ +class C { + suppress("REDUNDANT_NULLABLE") + class object { + val foo: String?? = null as Nothing?? + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onFunction.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onFunction.kt new file mode 100644 index 00000000000..082840860de --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onFunction.kt @@ -0,0 +1,4 @@ +class C { + suppress("REDUNDANT_NULLABLE") + fun foo(): String?? = null as Nothing?? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onLocalVariable.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onLocalVariable.kt new file mode 100644 index 00000000000..ead9e5f01c2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onLocalVariable.kt @@ -0,0 +1,7 @@ +class C { + fun foo(): Any? { + [suppress("REDUNDANT_NULLABLE")] + val v: String?? = null as Nothing?? + return v + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onObject.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onObject.kt new file mode 100644 index 00000000000..6a68f9634bd --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onObject.kt @@ -0,0 +1,4 @@ +suppress("REDUNDANT_NULLABLE") +object C { + fun foo(): String?? = null as Nothing?? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onParameter.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onParameter.kt new file mode 100644 index 00000000000..50930a07a02 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onParameter.kt @@ -0,0 +1,3 @@ +class C { + fun foo(suppress("REDUNDANT_NULLABLE") p: String?? = null as Nothing??) = p +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onProperty.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onProperty.kt new file mode 100644 index 00000000000..9d3788b8c94 --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onProperty.kt @@ -0,0 +1,4 @@ +class C { + suppress("REDUNDANT_NULLABLE") + val foo: String?? = null as Nothing? +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/oneWarning/onPropertyAccessor.kt b/compiler/testData/diagnostics/tests/suppress/oneWarning/onPropertyAccessor.kt new file mode 100644 index 00000000000..0dcdb3c5a0f --- /dev/null +++ b/compiler/testData/diagnostics/tests/suppress/oneWarning/onPropertyAccessor.kt @@ -0,0 +1,5 @@ +class C { + val foo: String? + [suppress("REDUNDANT_NULLABLE")] + get(): String?? = null as Nothing?? +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java index 826dd280080..eb94bac8917 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/checkers/JetDiagnosticsTestGenerated.java @@ -33,7 +33,7 @@ import org.jetbrains.jet.checkers.AbstractDiagnosticsTestWithEagerResolve; @InnerTestClasses({JetDiagnosticsTestGenerated.Tests.class, JetDiagnosticsTestGenerated.Script.class}) public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEagerResolve { @TestMetadata("compiler/testData/diagnostics/tests") - @InnerTestClasses({Tests.Annotations.class, Tests.BackingField.class, Tests.CallableReference.class, Tests.Cast.class, Tests.CheckArguments.class, Tests.ControlFlowAnalysis.class, Tests.ControlStructures.class, Tests.DataClasses.class, Tests.DataFlow.class, Tests.DataFlowInfoTraversal.class, Tests.DeclarationChecks.class, Tests.DelegatedProperty.class, Tests.Deparenthesize.class, Tests.Enum.class, Tests.Extensions.class, Tests.FunctionLiterals.class, Tests.Generics.class, Tests.IncompleteCode.class, Tests.Inference.class, Tests.Infos.class, Tests.Inner.class, Tests.J_k.class, Tests.Jdk_annotations.class, Tests.Library.class, Tests.NullabilityAndAutoCasts.class, Tests.NullableTypes.class, Tests.Numbers.class, Tests.Objects.class, Tests.OperatorsOverloading.class, Tests.Overload.class, Tests.Override.class, Tests.Recovery.class, Tests.Redeclarations.class, Tests.Regressions.class, Tests.Resolve.class, Tests.Scopes.class, Tests.SenselessComparison.class, Tests.Shadowing.class, Tests.SmartCasts.class, Tests.Substitutions.class, Tests.Subtyping.class, Tests.ThisAndSuper.class, Tests.Varargs.class, Tests.When.class}) + @InnerTestClasses({Tests.Annotations.class, Tests.BackingField.class, Tests.CallableReference.class, Tests.Cast.class, Tests.CheckArguments.class, Tests.ControlFlowAnalysis.class, Tests.ControlStructures.class, Tests.DataClasses.class, Tests.DataFlow.class, Tests.DataFlowInfoTraversal.class, Tests.DeclarationChecks.class, Tests.DelegatedProperty.class, Tests.Deparenthesize.class, Tests.Enum.class, Tests.Extensions.class, Tests.FunctionLiterals.class, Tests.Generics.class, Tests.IncompleteCode.class, Tests.Inference.class, Tests.Infos.class, Tests.Inner.class, Tests.J_k.class, Tests.Jdk_annotations.class, Tests.Library.class, Tests.NullabilityAndAutoCasts.class, Tests.NullableTypes.class, Tests.Numbers.class, Tests.Objects.class, Tests.OperatorsOverloading.class, Tests.Overload.class, Tests.Override.class, Tests.Recovery.class, Tests.Redeclarations.class, Tests.Regressions.class, Tests.Resolve.class, Tests.Scopes.class, Tests.SenselessComparison.class, Tests.Shadowing.class, Tests.SmartCasts.class, Tests.Substitutions.class, Tests.Subtyping.class, Tests.Suppress.class, Tests.ThisAndSuper.class, Tests.Varargs.class, Tests.When.class}) public static class Tests extends AbstractDiagnosticsTestWithEagerResolve { @TestMetadata("Abstract.kt") public void testAbstract() throws Exception { @@ -5565,6 +5565,162 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage } + @TestMetadata("compiler/testData/diagnostics/tests/suppress") + @InnerTestClasses({Suppress.AllWarnings.class, Suppress.ManyWarnings.class, Suppress.OneWarning.class}) + public static class Suppress extends AbstractDiagnosticsTestWithEagerResolve { + public void testAllFilesPresentInSuppress() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/diagnostics/tests/suppress"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("compiler/testData/diagnostics/tests/suppress/allWarnings") + public static class AllWarnings extends AbstractDiagnosticsTestWithEagerResolve { + public void testAllFilesPresentInAllWarnings() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/diagnostics/tests/suppress/allWarnings"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("suppressWarningsOnClass.kt") + public void testSuppressWarningsOnClass() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClass.kt"); + } + + @TestMetadata("suppressWarningsOnClassObject.kt") + public void testSuppressWarningsOnClassObject() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.kt"); + } + + @TestMetadata("suppressWarningsOnFunction.kt") + public void testSuppressWarningsOnFunction() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt"); + } + + @TestMetadata("suppressWarningsOnObject.kt") + public void testSuppressWarningsOnObject() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.kt"); + } + + @TestMetadata("suppressWarningsOnParameter.kt") + public void testSuppressWarningsOnParameter() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.kt"); + } + + @TestMetadata("suppressWarningsOnProperty.kt") + public void testSuppressWarningsOnProperty() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.kt"); + } + + @TestMetadata("suppressWarningsOnPropertyAccessor.kt") + public void testSuppressWarningsOnPropertyAccessor() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt"); + } + + } + + @TestMetadata("compiler/testData/diagnostics/tests/suppress/manyWarnings") + public static class ManyWarnings extends AbstractDiagnosticsTestWithEagerResolve { + public void testAllFilesPresentInManyWarnings() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/diagnostics/tests/suppress/manyWarnings"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("mixed.kt") + public void testMixed() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/manyWarnings/mixed.kt"); + } + + @TestMetadata("onClass.kt") + public void testOnClass() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/manyWarnings/onClass.kt"); + } + + @TestMetadata("onClassObject.kt") + public void testOnClassObject() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/manyWarnings/onClassObject.kt"); + } + + @TestMetadata("onFunction.kt") + public void testOnFunction() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/manyWarnings/onFunction.kt"); + } + + @TestMetadata("onObject.kt") + public void testOnObject() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/manyWarnings/onObject.kt"); + } + + @TestMetadata("onParameter.kt") + public void testOnParameter() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/manyWarnings/onParameter.kt"); + } + + @TestMetadata("onProperty.kt") + public void testOnProperty() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/manyWarnings/onProperty.kt"); + } + + @TestMetadata("onPropertyAccessor.kt") + public void testOnPropertyAccessor() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/manyWarnings/onPropertyAccessor.kt"); + } + + } + + @TestMetadata("compiler/testData/diagnostics/tests/suppress/oneWarning") + public static class OneWarning extends AbstractDiagnosticsTestWithEagerResolve { + public void testAllFilesPresentInOneWarning() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/diagnostics/tests/suppress/oneWarning"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("onClass.kt") + public void testOnClass() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onClass.kt"); + } + + @TestMetadata("onClassObject.kt") + public void testOnClassObject() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onClassObject.kt"); + } + + @TestMetadata("onFunction.kt") + public void testOnFunction() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onFunction.kt"); + } + + @TestMetadata("onLocalVariable.kt") + public void testOnLocalVariable() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onLocalVariable.kt"); + } + + @TestMetadata("onObject.kt") + public void testOnObject() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onObject.kt"); + } + + @TestMetadata("onParameter.kt") + public void testOnParameter() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onParameter.kt"); + } + + @TestMetadata("onProperty.kt") + public void testOnProperty() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onProperty.kt"); + } + + @TestMetadata("onPropertyAccessor.kt") + public void testOnPropertyAccessor() throws Exception { + doTest("compiler/testData/diagnostics/tests/suppress/oneWarning/onPropertyAccessor.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Suppress"); + suite.addTestSuite(Suppress.class); + suite.addTestSuite(AllWarnings.class); + suite.addTestSuite(ManyWarnings.class); + suite.addTestSuite(OneWarning.class); + return suite; + } + } + @TestMetadata("compiler/testData/diagnostics/tests/thisAndSuper") public static class ThisAndSuper extends AbstractDiagnosticsTestWithEagerResolve { public void testAllFilesPresentInThisAndSuper() throws Exception { @@ -5788,6 +5944,7 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage suite.addTest(SmartCasts.innerSuite()); suite.addTestSuite(Substitutions.class); suite.addTestSuite(Subtyping.class); + suite.addTest(Suppress.innerSuite()); suite.addTestSuite(ThisAndSuper.class); suite.addTestSuite(Varargs.class); suite.addTestSuite(When.class);