views:

1275

answers:

2

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 http://stackoverflow.com/questions/517560/how-do-i-get-team-build-to-show-test-results-and-coverage-for-xunit-net-test-suit 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 guesing this doesnt arise as commonly as the NUnit task takes multiple assemblies in its Assemblies parameter whereas xUnit.net has a singular Assembly parameter).

+2  A: 

I've used the MSBuild task from this blog post.

I hope this helps.

korchev
Thanks, Atanas - that looks like just the job (and looking at the impl, I'm glad I didnt attempt to do it myself!) (Havent looked at whether it works yet, but looks like it should)
Ruben Bartelink
+2  A: 

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.

jes
Hi, good to hear its working for you. FWIW, I was looking for (and got, thanks Atans again!) a task for combining NUnit XML - Combining xUnit XML is only something that's generally of interest in the context of building xUnit itself (There's an XSLT to convert onward from NUnit XML to MSTEST). I'd be interested to hear what you're cooking up [as a comment when you have 50 points!] Here's 10 to send you on your way... BTW the xUnit.net forum on CodePlex is obv well worth asking questions on too.
Ruben Bartelink
Thanks. I really should have given more context in my response. I found this post while searching for ways to get xUnit results for multiple test assemblies showing in CruiseControl build results. The single-assembly version is covered at the xUnit site on codeplex.
jes
Right, sorry for any tinge of patronising noob treatment in my response then! (I'll leave you the +1 tho' :D)
Ruben Bartelink