Display NUnit console output in CruiseControl.NET

I want to get console output along with regular test results in the CruiseControl.NET build log. I was able to get this earlier when I run NUnit from MSBuild, but now only test results appear when using the nUnit task directly. Is there a way to configure the nUnit task so that all test output is written to the build log?

+7
source share
2 answers

I could not figure out how to do this using the NUnit task, but with the exec task it was pretty easy.

Task:

<exec> <executable>C:\Program Files (x86)\NUnit 2.5.6\bin\net-2.0\nunit-console.exe</executable> <baseDirectory>C:\Tests</baseDirectory> <buildArgs>C:\Tests\Binaries\MyTests.dll /xml=TestResults.xml /output=TestOutput.txt /err=TestErrorOutput.txt</buildArgs> <buildTimeoutSeconds>600</buildTimeoutSeconds> <successExitCodes>0</successExitCodes> </exec> 

Publisher:

 <merge> <files> <file>C:\Tests\*Results.xml</file> <file>C:\Tests\*Output.txt</file> </files> </merge> 
+4
source share

The accepted answer is for starting NUnit from CruiseControl.NET, not MSBuild. Here is my code to run from MSBuild:

  <NUnit Assemblies="@(TestAssemblies)" ToolPath="$(BuildDir)\Servicing\Binaries\NUnit\2.5.5.10112\" OutputXmlFile="%(TestAssemblies.FileName)-Results.xml" /> 

You can then do merge tags in CCNet to combine output.

0
source share

All Articles