Coverage not outputting with nant or command line

Coverage not outputting with nant or command line

::::::::::::Versioning ::::::::::::: NCover - 1.5.5 NCoverExplorer - Latest NUnit - 2.4.1 Nant - 0.85.2478.0

::::::::::::Nant Script :::::::::::::

<property name="Component.MainComponent" value="CallAuditListingPortletAdapter"/>
<property name="DevTools.Location" value="C:\ROOT\devtools\"/>
<property name="CallAuditListingPortletAdapterTests.Location" value="C:\ROOT\tests\Adapters\CallAuditListingPortletAdapterNunitTests"/>
<property name="Component.KMSConfigurationHandler" value="KMSConfigurationHandler"/>
<property name="Component.ContentServerDBAdapter" value="ContentServerDBAdapter"/>
<property name="Component.CallAuditListingDBAdapter" value="CallAuditListingDBAdapter"/>


<!-- ******************** Run NCover against compiled test DLLs ******************** --> 

<target name="runNCover" description="Run NCover against compiled test DLLs">
<loadtasks assembly="${DevTools.Location}NCoverExplorer\bin\NCoverExplorer.NAntTasks.dll"/>
<ncover program="${DevTools.Location}NCover\NCover.Console.exe"
        commandLineExe="${DevTools.Location}nunit\bin\nunit-console.exe"
        commandLineArgs="${CallAuditListingPortletAdapterTests.Location}\bin\Debug\${Component.MainComponent}NunitTests.dll /xml="${CallAuditListingPortletAdapterTests.Location}\bin\Debug\${Component.MainComponent}NunitTests.dll-results.xml" /labels /nologo"
        workingDirectory="${project::get-base-directory()}"
        coverageFile="${CallAuditListingPortletAdapterTests.Location}\bin\Debug\Coverage.xml">
    <assemblies basedir="${project::get-base-directory()}\bin">
        <include name="${Component.MainComponent}.dll"/>
        <include name="${Component.KMSConfigurationHandler}.dll"/>
        <include name="${Component.ContentServerDBAdapter}.dll"/>
        <include name="${Component.CallAuditListingDBAdapter}.dll"/>
    </assemblies>
</ncover>
</target>

:::::::::::: Console Output ::::::::::::: runNCover:

[loadtasks] Scanning assembly "NCoverExplorer.NAntTasks" for extensions. [ncover] NCover.Console v1.5.5 - Code Coverage Analysis for .NET - <!-- m -->http://ncover.org<!-- m --> [ncover] Copyright (c) 2004-2005 Peter Waldschmidt [ncover] Command: C:\ROOT\devtools\nunit\bin\nunit-console.exe [ncover] Command Args: C:\ROOT\tests\Adapters\CallAuditListingPortletAdapterNunitTests\bin\Debug\CallAuditListingPortletAdapterNunitTests.dll /xml="C:\NHS24KMS\tests\Adapters\CallAuditListingPortletAdapterNunitTests\bin\Debug\CallAuditListingPortletAdapterNunitTests.dll-results.xml" /labels /nologo [ncover] Working Directory: C:\Documents and Settings\Administrator\Desktop [ncover] Assemblies: [ncover] Coverage Xml: C:\ROOT\tests\Adapters\CallAuditListingPortletAdapterNunitTests\bin\Debug\Coverage.xml [ncover] Coverage Log: coverage.log [ncover] The parameter is incorrect

:::::::::::: File Locations (Prior to NCover being called in the script - Nunit is run as a target beforehand) :::::::::::::

C:\ROOT\tests\Adapters\CallAuditListingPortletAdapterNunitTests\bin\Debug - ContentServerDBAdapter.dll - ContentServerDBAdapter.pdb - ContentServerDBAdapterNunitTests.dll-results.xml - CallAuditListingPortletAdapter.dll - CallAuditListingPortletAdapter.pdb - CallAuditListingPortletAdapterNunitTests.dll - CallAuditListingPortletAdapterNunitTests.dll-results.xml - CallAuditListingPortletAdapterNunitTests.pdb - CallAuditListingDBAdapter.dll - CallAuditListingDBAdapter.pdb - CallAuditListingDBAdapterNunitTests.dll-results.xml - KMSConfigurationHandler.dll - KMSConfigurationHandler.pdb - KMSConfigurationHandlerNunitTests.dll-results.xml

:::::::::::: Solution Structure :::::::::::::

ROOT ------- setup ------------- setup project for solution ------- src ------------- main source project and solution file ------------- dependant projects as part of solution in seperate directories ------- tests ------------- folders containing tests. 1 test project per project. These are in seperate directories

if Unit is run beforehand, do i need to specify the unit task within the NCover command line call? Im not sure what Ncover needs to work from. I already have the dlls, debug symbols and nunit result xml files prior to calling the NCover task. any help would be apprechaited

thanks

Sean


Re: Coverage not outputting with nant or command line

I think the error message you are getting is coming from NUnit or NAnt rather than NCover itself. "Parameter is Incorrect" is not an error message that NCover typically emits.

If I understand your question correctly, NUnit runs under NCover (NCover launches and monitors NUnit) so that it can collect code coverage data. So, yes, you must provide NUnit parameters to NCover so it will know how to launch NCover.

By the way, why are you running the 1.5.5 version of NCover. I'd suggest you upgrade to 1.5.8 at least. Of course 2.0 is the only supported version at this time.

Thanks, Peter Waldschmidt


Re: Coverage not outputting with nant or command line

thanks for the reply...

I have sampled with NCover, and i cant seem to get it to output a Coverage file via. the command line, however, it does copy the xsl stylesheet over.

What does it require to build a coverage file, just the debug symbols? I already have the tests dll, the results.xml file and the pdb file before running NCover.... cant i just pass these into the command line instead of running NUnit again when calling NCover?


Re: Coverage not outputting with nant or command line

You only need to run NUnit once. You just run it once under NCover and you'll get coverage statistics and test results at the same time.

NCover is a dynamic profiling tool. It monitors code while it is executing. It cannot tell you anything by just looking at the .dlls on disk.


Re: Coverage not outputting with nant or command line

i see, thats quite handy.

however, the build doesnt compile still with this knowledge??


Re: Coverage not outputting with nant or command line

[quote="s34n":81b82]however, the build doesnt compile still with this knowledge??[/quote:81b82]

I'm not sure if I understand what you mean exactly, but the NCover is not part of the build process. This is by design. NCover is designed to provide coverage analysis on the production versions of your code. For this reason, we do not modify the build or the generated code. We use the debugging symbols to determine the mapping between code and compiled IL while the program is running.


Re: Coverage not outputting with nant or command line

Of course its a part of the build process! it doesnt matter wheather it only replies on debugging symbols or not, if NCover fails, then the build will fail.

In my CC.NET Dashboard i am getting "Errors: (1)
External Program Failed: C:\NHS24KMS\devtools\NCover\NCover.Console.exe (return code was -100)"

if NCover was not a part of the build, it wouldnt explicity suggest NCover in my error log