Hi Leo,

You can try the <protect> + <always> combination -OR- the
<call> + tryeach option from AntXtras @ http://antxtras.sf.net.

Example 1 (using <call>):
   <call targets="clean.log,test.integration,report"
          haltiferror="no" tryeach="yes"
          failproperty="notclean.flag"/>

   This will execute all targets in order even if one or more fail.
   The 'failproperty' will be set 'true' if at least one failed.
   You could put a <fail if="notclean.flag"/> after the <call> if
   you want to abort the script if anything fails.


Example 2 (using <protect> and <always>):
   <protect>
     <sequential>
       <antcall target="clean.logs"/>
       <antcall target="test.integration"/>
     </sequential>
     <always>
        <antcall target="report"/>
     <always>
   </protect>

   This will always call the "report" target. BUT unlike the <call>
   usage this will 1) stop at the target that fails (subsequent
   targets are NOT called, 2) call the tasks defined in the <always>
   set (in this case your 'report' target), and 3) rethrow the
   original build exception that caused the <sequential> to abort.
   To prevent the abort use the 'haltiferror=no' parameter on the
   <protect>. To set a flag (like 'notclean.flag') use the <iferror>
   option to <protect> like:
       <protect>
          ...[see previous example]
          <iferror failproperty="notclean.flag"/>
       </protect>
       <fail if="notclean.flag" message="..."/>

HTH,
The Wabbit

Leo Arias F. wrote:
Hello ant.

I'm using the junit task to execute selenium tests using ant and java.
By the way, it's working great. Thanks to those involved in the
development.

Now I need a report of all the tests that were executed. I created a
target called report that combines all the logs and creates a single
file. The problem is that I don't know how to force ant to run this
task always.

This is my target:
<sequential>
        <antcall target="clean.log"/>
        <antcall target="test.integration.smoke" />
        <antcall target="report" />     
</sequential>

So, when test.integration.smoke fails, report is not executed. Todo mal :(

I'll appreciate your help a lot.
thanks,
pura vida.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to