diff --git a/jps/jps-plugin/jps-tests/jps-tests.iml b/jps/jps-plugin/jps-tests/jps-tests.iml
index 1772d1a64c3..4cec7e15e41 100644
--- a/jps/jps-plugin/jps-tests/jps-tests.iml
+++ b/jps/jps-plugin/jps-tests/jps-tests.iml
@@ -19,5 +19,6 @@
+
\ No newline at end of file
diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt
index 944ed4380cd..d8f87476e2e 100644
--- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt
+++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt
@@ -51,6 +51,9 @@ import org.jetbrains.jps.model.java.JpsJavaSdkType
import org.jetbrains.jps.model.library.JpsOrderRootType
import org.jetbrains.jps.model.module.JpsModule
import org.jetbrains.jps.util.JpsPathUtil
+import org.jetbrains.kotlin.cli.common.Usage
+import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
+import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.kotlin.codegen.JvmCodegenUtil
import org.jetbrains.kotlin.config.KotlinCompilerVersion.TEST_IS_PRE_RELEASE_SYSTEM_PROPERTY
@@ -787,6 +790,26 @@ class KotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
)
}
+ fun testHelp() {
+ initProject()
+
+ val result = buildAllModules()
+ result.assertSuccessful()
+ val warning = result.getMessages(BuildMessage.Kind.WARNING).single()
+
+ Assert.assertEquals(Usage.render(K2JVMCompiler(), K2JVMCompilerArguments()), warning.messageText)
+ }
+
+ fun testWrongArgument() {
+ initProject()
+
+ val result = buildAllModules()
+ result.assertFailed()
+ val errors = result.getMessages(BuildMessage.Kind.ERROR).joinToString("\n\n") { it.messageText }
+
+ Assert.assertEquals("Invalid argument: -abcdefghij-invalid-argument", errors)
+ }
+
fun testCodeInKotlinPackage() {
initProject(JVM_MOCK_RUNTIME)
diff --git a/jps/jps-plugin/testData/general/Help/kotlinProject.iml b/jps/jps-plugin/testData/general/Help/kotlinProject.iml
new file mode 100644
index 00000000000..a0cbe548242
--- /dev/null
+++ b/jps/jps-plugin/testData/general/Help/kotlinProject.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jps/jps-plugin/testData/general/Help/kotlinProject.ipr b/jps/jps-plugin/testData/general/Help/kotlinProject.ipr
new file mode 100644
index 00000000000..102bdf0ea20
--- /dev/null
+++ b/jps/jps-plugin/testData/general/Help/kotlinProject.ipr
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/jps/jps-plugin/testData/general/Help/src/test.kt b/jps/jps-plugin/testData/general/Help/src/test.kt
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/jps/jps-plugin/testData/general/WrongArgument/kotlinProject.iml b/jps/jps-plugin/testData/general/WrongArgument/kotlinProject.iml
new file mode 100644
index 00000000000..a0cbe548242
--- /dev/null
+++ b/jps/jps-plugin/testData/general/WrongArgument/kotlinProject.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jps/jps-plugin/testData/general/WrongArgument/kotlinProject.ipr b/jps/jps-plugin/testData/general/WrongArgument/kotlinProject.ipr
new file mode 100644
index 00000000000..a9c7f866ea1
--- /dev/null
+++ b/jps/jps-plugin/testData/general/WrongArgument/kotlinProject.ipr
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/jps/jps-plugin/testData/general/WrongArgument/src/test.kt b/jps/jps-plugin/testData/general/WrongArgument/src/test.kt
new file mode 100644
index 00000000000..e69de29bb2d