Eric Deslauriers wrote:

What I need to do with the above snippet is change test’s failonerror to TRUE when not doing code coverage, but to FALSE when doing codecoverage, then pass the fail back to codecov to propogate out. Basically like catching and rethrowing an exception.


Thanks!,

Eric


Eric,

May I propose a much simpler solution, which you actually touched on in your message... I was doing something very similar in a previous project - performing an operation which required some cleanup, even if it failed.

The cleanest solution (IMHO) was to create a custom try/catch/finally task... your codecov target becomes:

<target name="codecov" depends="codecov-start" failonerror=”true”>
  <try>
    <call target="codecov-start" />
    <call target="test" />
    <finally>
      <call target="codecov-stop" />
    </finally>
  </try>
</target>

The trivial implementation of this task (check out the source for the If task for guidance) is sufficient for doing something like the above... If you have issues creating the task, send me a mail and I'll dig up my implementation and send it to you.


Hope this helps,

-- Troy


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to