开发者

Displaying NUnit console output in CruiseControl.NET

开发者 https://www.devze.com 2023-01-09 02:26 出处:网络
I want to get the conso开发者_开发知识库le output along with the regular test results in the CruiseControl.NET build log. I was able to get this before when running NUnit from MSBuild, but now only th

I want to get the conso开发者_开发知识库le output along with the regular test results in the CruiseControl.NET build log. I was able to get this before when running NUnit from MSBuild, but now only the results of the tests are showing up when using the nUnit task directly. Is there a way to configure the nUnit task so all test output is written to the build log?


I couldn't figure out how to do it 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>


The accepted answer appears to be for running NUnit from CruiseControl.NET and not MSBuild. Here is my code for running from within MSBuild:

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

Then you can do the merge tags within CCNet to merge the output.

0

精彩评论

暂无评论...
验证码 换一张
取 消