NCover commandline call from Nant Script
NCover commandline call from Nant Script
hi there,
im currently building a continuous integration nant script and im trying to incorporate NCover documentation into the build process.
when i run the command below, i get file cant be found errors, but all dirs do exist! is there anything im doing wrong? im pretty sure i have specified the correct paths fopr the correct params.
Am i right im saying that when this command is executed, itll create a log and xml file containing the % of tested code? (what im looking for is to create coverage for my example dll, then show this in cruisecontrol - but one step at a time - is this all thats required in the NAnt script section?)
p.s. im using exec because the <ncover> tags dont seem to be recognised... im imported NAnt contrib and NCover dll's, but still doesnt recognise
thanks
-----------------------------
runNCover:
[echo] Starting NUnit code coverage run...
[mkdir] Creating directory 'C:\WorkingFolder\BuildingSolution\bin\Latest\cov
erage_results'.
[exec] NCover.Console v1.5.4 - Code Coverage Analysis for .NET - http://nco
ver.org
[exec] Copyright (c) 2004-2005 Peter Waldschmidt
[exec] Command: /c
[exec] Command Args: C:\WorkingFolder\devtools\nunit\bin\nunit-console.exe
C:\WorkingFolder\BuildingSolution\bin\Latest\BuildingBL.dll
/xml:C:\WorkingFolder\BuildingSolution\bin\Latest\BuildingTest.dll-results.xml
/w C:\WorkingFolder\devtools\nunit\bin
/o C:\WorkingFolder\BuildingSolution\bin\Latest\coverage_results\Coverage.xml
/l C:\WorkingFolder\BuildingSolution\bin\Latest\coverage_results\Coverage.log
[exec] Working Directory:
[exec] Assemblies:
[exec] Coverage Xml: Coverage.Xml
[exec] Coverage Log: Coverage.Log
[exec] The system cannot find the file specified
BUILD FAILED
C:\WorkingFolder\BuildingSolution\BuildingSolution.build(69,5):
External Program Failed: C:\WorkingFolder\devtools\NCover\NCover.Console.exe (re
turn code was 1)
nant script:
<!-- runNCover will run coverage on the nunit scripts -->
<target name="runNCover" description="Runs Coverage">
<echo message="Starting NUnit code coverage run..."/>
<mkdir dir="${Build.OutputFolder}${sys.version}\coverage_results" failonerror="false"/>
<!-- path to coverage app and working directory -->
<exec program="${DevTools.Location}NCover\NCover.Console.exe" workingdir="${DevTools.Location}NCover" >
<!-- /c parameter is the application to run and profile: this case nunit and its project file -->
<arg value="/c ${DevTools.Location}nunit\bin\nunit-console.exe "${Build.OutputFolder}${sys.version}\BuildingBL.dll /xml:${Build.OutputFolder}${sys.version}\BuildingTest.dll-results.xml"" />
<!-- /w parameter is the working directory for nunit -->
<arg value="/w "${DevTools.Location}nunit\bin""/>
<!-- /o paramter is where to write the coverage results -->
<arg value="/o "${Build.OutputFolder}${sys.version}\coverage_results\Coverage.xml"" />
<!-- /l parameter is where to write coverage log file -->
<arg value="/l "${Build.OutputFolder}${sys.version}\coverage_results\Coverage.log"" />
<!-- /a parameter - VERY IMPORTANT: list of assemblies to do
coverage for, if not specified it will run coverage on all assemblies
loaded by nunit -->
<!-- <arg value="/a "Assembly1;Assembly2;Assembly3;Assembly4"" /> -->
</exec>
</target>