I've come across this problem too, and have worked around it as
follows.
We use an msbuild script to run our build but the pronciples will be
the same. When we run the unit tests and code coverage, we set
ContinueOnError="true" in order to complete the tasks irrespective of
failures in the unit tests. Following on from this, we have another
target that will open each of the report files, and add together the
failure count found via the XPath expression //report-result/counter/
@failure-count
If the total failures is greater than 0, we throw an error which
CruiseControl.Net will capture and report the build has failed, and
still incorporate the test results and code coverage. I have included
two extracts below to show how we do this with msbuild.
Hope this helps
Andrew
<!-- Targets from here on only defile high-level tasks, combining
previously defined targets. -->
<Target Name="FullCompileAndTest"
DependsOnTargets="CompileSrcSln;RunTests;ReturnBuildStatus"/>
.....
<Target Name="ReturnBuildStatus" DependsOnTargets="RunTests">
<CreateItem Include="$(RootSourceFolder)\Build\ci\unitTests
\*.xml">
<Output TaskParameter="Include" ItemName="UnitTestFiles" />
</CreateItem>
<XmlQuery
XmlFileName="%(UnitTestFiles.Identity)"
XPath="sum(//report-result/counter/@failure-count)">
<Output TaskParameter="Values" ItemName="FailureCounts" />
</XmlQuery>
<Math.Add Numbers="@(FailureCounts)">
<Output TaskParameter="Result" PropertyName="FailureCount" />
</Math.Add>
<Message Text="FailureCount $(FailureCount)"/>
<Error Condition=" '$(FailureCount)' > '0' "
Code="1"
Text="$(FailureCount) Unit tests failed" />
</Target>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---