开发者

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 follow开发者_开发百科ing:

 <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...


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}" />


Have you tried setting runnerMode to DEBUG?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜