dcsimg
How can I get the junit task to run all tasks first, then fail the build if necessary, rather than aborting as soon as one of the tests fails?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alex_Chaffee
Posted On:   Monday, February 18, 2002 08:07 AM

Currently, it seems to take the "haltonfailure" and "haltonerror" tasks to mean "halt immediately on the first test failure." But I'd like it to run all the tests, then show me which ones failed, then halt the build. I suppose the following could work: fork="yes" failureproperty="testfailed"> But it seems kind of obscure -- make a new target whose only purpose is to fail? Seems a lot more complicated than just which was working fine before I started using the junit task...    More>>

Currently, it seems to take the "haltonfailure" and "haltonerror" tasks to mean "halt immediately on the first test failure." But I'd like it to run all the tests, then show me which ones failed, then halt the build.


I suppose the following could work:

			


fork="yes"
failureproperty="testfailed">




















But it seems kind of obscure -- make a new target whose only purpose is to fail? Seems a lot more complicated than just

			







which was working fine before I started using the junit task...    <<Less

Re: How can I get the junit task to run all tasks first, then fail the build if necessary, rather than aborting as soon as one of the tests fails?

Posted By:   Erik_Hatcher  
Posted On:   Monday, February 18, 2002 02:17 PM

The trick is to set haltonerror and haltonfailure both to "off" and then use errorproperty="testfailed" and failureproperty="testfailed" both. That should work in your case. In the nightly builds of Ant there is a conditional added to the task which eliminates the need for the two-target hack, but still allows the build to fail when tests fail and have post-test processing.
About | Sitemap | Contact