KT-1529: Failing module compilation doesn't fail Maven build - test added.

This commit is contained in:
Evgeny Goldin
2012-03-07 21:08:14 +01:00
parent 710b22debe
commit 33f5b07997
2 changed files with 23 additions and 1 deletions
+20 -1
View File
@@ -61,6 +61,7 @@
<antcall target = "zip"/>
<verify-exists file="${output}/${output.name}.zip" type="file"/>
<!-- Sometimes deleting "dist/kotlinc/lib/alt/kotlin-jdk-headers.jar" fails -->
<delete dir = "${kotlin-home}" failonerror="false"/>
<mkdir dir = "${kotlin-home}"/>
<unzip src = "${output}/${output.name}.zip" dest="${output}"/>
@@ -309,7 +310,7 @@
<then>
<!-- Batch tests -->
<if>
<matches string="@{classpath}" pattern="\.jar$"/>
<matches string="@{classpath}" pattern="/.jar$"/>
<then>
<!-- Batch tests from a jar -->
<echo>Running JUnit: classpath = "@{classpath}" (Jar)</echo>
@@ -434,6 +435,24 @@
<fail message="kotlinc-jar: compilation should have failed!"/>
</then>
</if>
<var name="failed" value="false"/>
<trycatch property="error-message" reference="bar">
<try>
<!-- Should fail -->
<kotlinc-jar module = "${basedir}/build-tools/test/compilation-fail/Smoke.kts"/>
</try>
<catch>
<var name="failed" value="true"/>
<echo>"ERROR:" was expected here</echo>
</catch>
</trycatch>
<if>
<isfalse value="${failed}"/>
<then>
<fail message="kotlinc-jar: compilation should have failed!"/>
</then>
</if>
</sequential>
</macrodef>
@@ -0,0 +1,3 @@
import kotlin.modules.*
fun proj