I have a set of NUnit XML result files (produced by xUnit.NET via the NUnitXml parameter to the Xunit.Runner.MSBuild.xunit msbuild task pretty much as in How do I get Team Build to show test results and coverage for xUnit.net test suite? and http://jonnekats.wordpress.com/2009/05/07/integrate-xunit-tests-into-your-daily-team-build/)
The script publishes each of the test runs individually, which is slow as it pulls in all the TestResults artifacts each time. Thus I'd like to combine them into a single consolidated set on the client side first prior to submission [to TFS using mstest.exe with the /publish parameter].
xUnit.net has a CombineXunitXml Task which is invoked in xunit.tests.msbuild as follows:-
<CombineXunitXml InputFiles="@(TestXmlFiles)" OutputFile="TestResults.xml" />
Does anyone know of an equivalent task to merge NUnit result files in a similar way? (I'm guessing this doesnt arise as commonly as the NUnit task takes multiple assemblies in its Assemblies parameter whereas xUnit.net has a singular Assembly parameter).
The CombineXunitXml task does not exist in xUnit 1.1. Copying the class from the source for 1.5 (currently CTP2) into the solution for 1.1, it built just fine for me.
I couldn't get Davy Brion's build task to work when I tried (the link in Atanas Korchev's answer).
So we wrote an open source replacement:
https://github.com/15below/NUnitMerger
From the readme:
Using in MSBuild
Load the task:
Feed it an array of files with in a target:
Find the resulting combined results at OutputPath.
Using in F#
Create an F# console app and add 15below.NUnitMerger.dll, System.Xml and System.Xml.Linq as references.