Passing a command line argument to jstestdriver JAR from ANT?
Asked Answered
E

2

8

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

Estell answered 4/6, 2010 at 18:16 Comment(0)
C
1

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}" />
Cammie answered 4/6, 2010 at 18:35 Comment(3)
Found it! It was a mis-spelled property name...it caused it to have no output.Estell
It was report.dir not reports.dir :-pEstell
I think the default for runnerMode is SILENT, so when you set it to DEBUG, you should be able to see error messagesRemoval
R
0

Have you tried setting runnerMode to DEBUG?

Removal answered 30/5, 2012 at 15:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.