Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing a command line argument to jstestdriver JAR from ANT?

I'm trying to use jstestdriver to generate some unit tests in my ant build in Windows. I plan to do this by running jstestdriver from an ant target using the <java> ant task.

So far for my ant build file I have the following:

 <target name="jstestdriver" description="Runs the js unit tests">

        ...

Now inside the <java> tags ( "..." above) I've tried adding the following:

 <arg value="--config" />
 <arg value="../../jstestdriver.conf" />

 <arg value="--tests" />
 <arg value="${whichTests}" />

 <arg value="--testOutput" />    
 <arg value="${reports.dir}" />

When I run the jstestdriver target, no messages are displayed on the console, and there are no junit output files in the directory they are to be generated in.


I have also tried the code snippet below instead, which seems to indicate that the jar is being executed:

 <arg value="--config ..\..\jstestdriver.conf" />
 <arg value="--tests ${whichTests}" />
 <arg value="--testOutput ${reports.dir}" />

However all it does is display an error message:

  "--config ..\..\jstestdriver.conf" is not a valid option

...and additionally displays a list of options for the jstestdriver jar.

I'm not sure what I'm doing wrong...

like image 292
leeand00 Avatar asked Jun 04 '10 18:06

leeand00


1 Answers

I think it's likely that you want to break each argument and its value into separate arguments. E.g.:

<arg value="--config" />
<arg value="..\..\jstestdriver.conf" />
<arg value="--tests" />
<arg value="${whichTests}" />
<arg value="--testOutput" />
<arg value="${report.dir}" />
like image 65
Kaleb Pederson Avatar answered Nov 14 '22 21:11

Kaleb Pederson