ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: junit Looping?
Date Tue, 03 Jun 2003 20:16:18 GMT
<target name="-test">
  <!-- default values -->
  <property name="-test.includes" value="**/Test*.class" />
  <property name="-test.excludes" value="" />

  <junit fork="yes" dir="${-test.dir}">
    <fileset dir="${-test.classdir}"
             includes="${-test.includes}"
             excludes="${-test.excludes}" />
  </junit>
</target>

<target name="test">
  <antcall target="-test">
    <param name="-test.dir"      location="dir1" />
    <param name="-test.classdir" location="classdir1" />
  </antcall>

  <antcall target="-test">
    <param name="-test.dir"      location="dir2" />
    <param name="-test.classdir" location="classdir2" />
    <param name="-test.includes" value="**/*Test*.class" />
    <param name="-test.excludes" value="NotThisTest.class" />
  </antcall>
</target>

Which is actually longer than your contrived example ;-)
Eh, it's because Ant is not supposed to be functional/scripty... --DD

> -----Original Message-----
> From: Clint Shank [mailto:clint_shank@fanniemae.com]
> Sent: Tuesday, June 03, 2003 1:57 PM
> To: user@ant.apache.org
> Subject: junit Looping?
> 
> I need to execute a set of junit tasks that differ only in the directory
> from which the VM is invoked and the set of JUnit tests that are run.
> The copy and paste solution (showing only relevant nodes) looks like this:
> 
> <junit fork="yes" dir="dir1">
> <fileset
> dir="classdir1"
> includes="**/Test*.class"
> />
> </junit>
> <junit fork="yes" dir="dir2">
> <fileset
> dir="classdir2"
> includes="**/*Test*.class"
> excludes="NotThisTest.class"
> />
> </junit>
> 
> There are about five of these junit elements. Any suggestions to reduce
> the duplication?

Mime
View raw message