diff --git a/compiler/testData/cli/jvm/jsr305Ignore.args b/compiler/testData/cli/jvm/jsr305Ignore.args new file mode 100644 index 00000000000..fa848bd4cc4 --- /dev/null +++ b/compiler/testData/cli/jvm/jsr305Ignore.args @@ -0,0 +1,5 @@ +-Xjsr305=ignore +$TESTDATA_DIR$/jsr305Usage.kt +$TESTDATA_DIR$/jsr305 +-d +$TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/jsr305Ignore.out b/compiler/testData/cli/jvm/jsr305Ignore.out new file mode 100644 index 00000000000..d86bac9de59 --- /dev/null +++ b/compiler/testData/cli/jvm/jsr305Ignore.out @@ -0,0 +1 @@ +OK diff --git a/compiler/testData/cli/jvm/jsr305Strict.args b/compiler/testData/cli/jvm/jsr305Strict.args new file mode 100644 index 00000000000..34eda998f64 --- /dev/null +++ b/compiler/testData/cli/jvm/jsr305Strict.args @@ -0,0 +1,5 @@ +-Xjsr305=strict +$TESTDATA_DIR$/jsr305Usage.kt +$TESTDATA_DIR$/jsr305 +-d +$TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/jsr305Strict.out b/compiler/testData/cli/jvm/jsr305Strict.out new file mode 100644 index 00000000000..ddbd4018555 --- /dev/null +++ b/compiler/testData/cli/jvm/jsr305Strict.out @@ -0,0 +1,4 @@ +compiler/testData/cli/jvm/jsr305Usage.kt:2:11: error: null can not be a value of a non-null type String + a.foo(null) + ^ +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/jsr305Usage.kt b/compiler/testData/cli/jvm/jsr305Usage.kt new file mode 100644 index 00000000000..bb806147851 --- /dev/null +++ b/compiler/testData/cli/jvm/jsr305Usage.kt @@ -0,0 +1,3 @@ +fun bar(a: A) { + a.foo(null) +} diff --git a/compiler/testData/cli/jvm/jsr305Warn.args b/compiler/testData/cli/jvm/jsr305Warn.args new file mode 100644 index 00000000000..cffba4cad92 --- /dev/null +++ b/compiler/testData/cli/jvm/jsr305Warn.args @@ -0,0 +1,5 @@ +-Xjsr305=warn +$TESTDATA_DIR$/jsr305Usage.kt +$TESTDATA_DIR$/jsr305 +-d +$TEMP_DIR$ diff --git a/compiler/testData/cli/jvm/jsr305Warn.out b/compiler/testData/cli/jvm/jsr305Warn.out new file mode 100644 index 00000000000..1d7080a67e5 --- /dev/null +++ b/compiler/testData/cli/jvm/jsr305Warn.out @@ -0,0 +1,4 @@ +compiler/testData/cli/jvm/jsr305Usage.kt:2:11: warning: expected type does not accept nulls in Java, but the value may be null in Kotlin + a.foo(null) + ^ +OK diff --git a/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java index 7dbcec601cb..09e39f26771 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -218,12 +218,30 @@ public class CliTestGenerated extends AbstractCliTest { doJvmTest(fileName); } + @TestMetadata("jsr305Ignore.args") + public void testJsr305Ignore() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/jsr305Ignore.args"); + doJvmTest(fileName); + } + @TestMetadata("jsr305NoFlag.args") public void testJsr305NoFlag() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/jsr305NoFlag.args"); doJvmTest(fileName); } + @TestMetadata("jsr305Strict.args") + public void testJsr305Strict() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/jsr305Strict.args"); + doJvmTest(fileName); + } + + @TestMetadata("jsr305Warn.args") + public void testJsr305Warn() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/jsr305Warn.args"); + doJvmTest(fileName); + } + @TestMetadata("jvm8Target.args") public void testJvm8Target() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/cli/jvm/jvm8Target.args");