summaryrefslogtreecommitdiff
path: root/build.xml
diff options
context:
space:
mode:
authorAntoine Gourlay <antoine@gourlay.fr>2014-08-22 14:49:18 +0200
committerAntoine Gourlay <antoine@gourlay.fr>2014-08-25 10:33:35 +0200
commit42f8a96a37cdeb869382b0a1bb084296299302c4 (patch)
tree3bc6d2ac42ef2f103640bf544fb174428b7c2565 /build.xml
parentd4b5c7b95de88d3890be654e06da812c6eb607f5 (diff)
downloadscala-42f8a96a37cdeb869382b0a1bb084296299302c4.tar.gz
scala-42f8a96a37cdeb869382b0a1bb084296299302c4.tar.bz2
scala-42f8a96a37cdeb869382b0a1bb084296299302c4.zip
Add support for running a specific Junit test/method.
Unless I really missed something, there is currently no way to run a specific Junit test (class or method). Running the whole thing is going to get worse and worse since Junit is supposed to be the preferred way, so here it goes: // will run all methods in a test file ant test.junit -Dtest.class=scala.WhateverTest // will run a specific method (just an alias for the one below) ant test.junit -Dtest.class=scala.WhateverTest -Dtest.method=mymethod // will run several methods (comma separated) ant test.junit -Dtest.class=scala.WhateverTest -Dtest.methods="foo,bar" `test.method(s)` without `test.class` is just ignored (all tests are run).
Diffstat (limited to 'build.xml')
-rwxr-xr-xbuild.xml6
1 files changed, 5 insertions, 1 deletions
diff --git a/build.xml b/build.xml
index b7950f971c..6c750e530d 100755
--- a/build.xml
+++ b/build.xml
@@ -1440,9 +1440,13 @@ TODO:
<stopwatch name="test.junit.timer"/>
<mkdir dir="${test.junit.classes}"/>
<echo message="Note: details of failed tests will be output to ${build-junit.dir}"/>
+
+ <if><isset property="test.method" /><then><property name="test.methods" value="${test.method}" /></then></if>
<junit fork="yes" haltonfailure="yes" printsummary="on">
<classpath refid="test.junit.compiler.build.path"/>
- <batchtest fork="yes" todir="${build-junit.dir}">
+ <test fork="yes" todir="${build-junit.dir}" if="test.class" unless="test.methods" name="${test.class}" />
+ <test fork="yes" todir="${build-junit.dir}" if="test.methods" name="${test.class}" methods="${test.methods}" />
+ <batchtest fork="yes" todir="${build-junit.dir}" unless="test.class">
<fileset dir="${test.junit.classes}">
<include name="**/*Test.class"/>
</fileset>