You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by tabber <to...@gmail.com> on 2010/08/11 17:45:11 UTC

Can ant run non-JUnit tests that can produce Junit xml formatted output?

We are evaluating ANT to setup out build process. We have a lot of our tests
written in c and functional test written in an ih house developed language.
There tests produce text output which I can parse and generate JUnit like
XML output. 

How do I make ANT run these tests for each build? Is exec task in ANT the
best way to do it?
-- 
View this message in context: http://ant.1045680.n5.nabble.com/Can-ant-run-non-JUnit-tests-that-can-produce-Junit-xml-formatted-output-tp2472091p2472091.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Can ant run non-JUnit tests that can produce Junit xml formatted output?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-08-12, tabber wrote:

> 1) You suggested 'another one would be to write your own task that wraps
> the exec invocation itself.' -- I am wondering what benefit it will be to do
> this?

A nicer syntax with less potential for errors.

Contrast the completely hypothetical

         <mytests report="myfile.txt" spec="tests.spec"/>

with

        <exec executable="mytests.sh">
          <arg value="-o"/>
          <arg file="myfile.txt"/>
          <arg value="--spec"/>
          <arg file="tests.spec"/>
        </exec>

> 2) Currently our tests are run using a shell script on Linux/solaris boxes
> which are basically cron jobs. They dont run as soon as a build is
> completed. They run once every night on a build we assume will have been
> created by the time the cron triggers.

> If the output is not XML then can ANT understand the results at all?

It depends on what you want to do with them.

The <junitreport> task basically aggregates XML files and applies a
custom XSLT reansformation - this one expects a specific XML format.  If
the output is not XML and you want to use <junitreport>, you will need
some sort of trasnformation step inbetween - which may just be a <copy>
or <concat> with some custim filterreader logic.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Can ant run non-JUnit tests that can produce Junit xml formatted output?

Posted by tabber <to...@gmail.com>.
Thank you for the suggestion, Stefan!

I have 2 more questions...

1) You suggested 'another one would be to write your own task that wraps 
the exec invocation itself.' -- I am wondering what benefit it will be to do
this?

2) Currently our tests are run using a shell script on Linux/solaris boxes
which are basically cron jobs. They dont run as soon as a build is
completed. They run once every night on a build we assume will have been
created by the time the cron triggers.

If the output is not XML then can ANT understand the results at all? For
example if results are in TAP format then can ANT understand the test
results?

-- 
View this message in context: http://ant.1045680.n5.nabble.com/Can-ant-run-non-JUnit-tests-that-can-produce-Junit-xml-formatted-output-tp2472091p2472975.html
Sent from the Ant - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Can ant run non-JUnit tests that can produce Junit xml formatted output?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-08-11, tabber wrote:

> We are evaluating ANT to setup out build process. We have a lot of our tests
> written in c and functional test written in an ih house developed language.
> There tests produce text output which I can parse and generate JUnit like
> XML output.

> How do I make ANT run these tests for each build? Is exec task in ANT the
> best way to do it?

It is one option, another one would be to write your own task that wraps
the exec invocation itself.  Without knowing more about the way you run
the tests there isn't really much opne could answer.

Yes, <exec> would work and if the XML output looks like the one of
<junit> then <junitreport> will work as well.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org