add test to check that "Only the Kotlin standard library is allowed to use the 'kotlin' package" is reported in JPS builds

This commit is contained in:
Dmitry Jemerov
2016-01-14 14:30:23 +01:00
parent 39ad2b2378
commit 39c6e3712b
4 changed files with 41 additions and 0 deletions
@@ -697,6 +697,16 @@ class KotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
)
}
fun testCodeInKotlinPackage() {
initProject()
val result = makeAll()
result.assertFailed()
val errors = result.getMessages(BuildMessage.Kind.ERROR)
Assert.assertEquals("Only the Kotlin standard library is allowed to use the 'kotlin' package", errors.single().messageText)
}
fun testDoNotCreateUselessKotlinIncrementalCaches() {
initProject()
makeAll().assertSuccessful()
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="IDEA_JDK" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="kotlinProject" />
</component>
</module>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/kotlinProject.iml" filepath="$PROJECT_DIR$/kotlinProject.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA_JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
@@ -0,0 +1,5 @@
package kotlin.forever
fun foo() {
}