Click here to Skip to main content
Sign Up to vote bad
good
See more: ASP.NETMSBuild
Hi,
 
I got below ouput for NCover of my c# based project
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
 
C:\Windows\system32>cd..
 
C:\Windows>cd..
 
C:\>cd Program Files
 
C:\Program Files>cd NCover
 
C:\Program Files\NCover>ncover.console D:\Mymath\Mymath\bin\Debug\Mymath.exe
NCover Complete Trial v3.4.18.6937 x86 (Administrator)
Copyright (c) 2007 - 2010 Gnoso Inc.
License Key: QYSX1DBZRB6VPYAA
Registered to Customer #: 65856 for 1 Machine
20 days left in the trial period.
 

Command: "D:\Mymath\Mymath\bin\Debug\Mymath.exe"
Command Args:
Working Directory:
Assemblies: (All Loaded Assemblies)
 
******************* Program Output *******************
Process 'Mymath' [PID 4052] has begun profiling.
Process 'Mymath' [PID 4052] has finished profiling.
 
***************** End Program Output *****************
 
Execution Time: 74.8423 s
Symbol Coverage: 35.45%
Branch Coverage: 23.44%
 
Coverage File: C:\Program Files\NCover\coverage.nccov
 

Now i am trying to get this code coverage percentage from cruisecontrol.net for that i created build script as shown below:
<project defaulttargets="Build">
	xmlns="http://schemas.microsoft.com/developer/msbuild/2003">    
    <import project="<br" mode="hold" />      "C:\Program Files\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>            
     <target name="Build">
        <msbuild projects="D:\Mymath\Mymath.sln" /> 
         <calltarget targets="Test" />  
         <calltarget targets="CoverMyCode" />
         <calltarget targets="CreateCoverageReports" />     
    </target>
    <target name="Test">
       <message text="Tests to run"></message>
       <nunit assemblies="D:\Mymath\MyMathTest2\bin\Debug\MyMathTest2.dll">
           ContinueOnError="false"
           DisableShadowCopy="true"
           ToolPath="C:\Program Files\NUnit 2.5.10\bin\net-2.0\nunit-console-x86.exe"
           OutputXmlFile="$(Logs)\nunit-results.xml" />
   </nunit></target>
   <target name="CoverMyCode">
    <ncover toolpath="C:\Program Files\NCover\NCover.Console.exe">
        TestRunnerExe="C:\Program Files\NUnit 2.5.10\bin\net-2.0\nunit-console-x86.exe"
        TestRunnerArgs=".\release\ncover.test.unit.dll /xml NCover-NUnit-Results.xml"
        CoverageFile="unittest_coverage.xml"
        ExcludeAssemblies="NCover.Test.*;NCover.Framework.XmlSerializers"
    />
   </ncover></target>
   <propertygroup>
    <reports>
        <report>
            <reporttype>SymbolModule</reporttype>
            <Format>Xml</Format>
            <outputpath>.\coverage\symbolmodule.xml</outputpath>
        </report>
    </reports>
   </propertygroup>
 
  <target name="CreateCoverageReports">
    <ncoverreporting toolpath="C:\Program Files\NCover\NCover.Reporting.exe">
        CoverageDataPaths="unittest_coverage.xml"
        OutputReport="$(Reports)"
    />
  </ncoverreporting></target>
 
</project>
 
and my ccnet.config file code as shown below:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
  <project name="Test16Project">   
    <weburl>http://localhost:8080/ccnet/</weburl>
    <triggers>
      <intervaltrigger seconds="60" />
    </triggers>   
    <tasks>
      <msbuild>
        <executable>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</executable>
        <workingdirectory>D:\build1</workingdirectory>
        <projectfile>D:\Mymath\Mymath.sln</projectfile>
        <buildargs>/v:quiet /noconlog /p:Configuration=Debug</buildargs>
        <targets>Build</targets>
        <timeout>900</timeout>
        <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MSBuild.dll</logger>
      </msbuild>
      <exec>
        <executable>C:\Program Files\NUnit 2.5.10\bin\net-2.0\nunit-console-x86.exe</executable>
        <baseDirectory>D:\Mymath</baseDirectory>
        <buildargs>D:\Mymath\MyMathTest2\bin\Debug\MyMathTest2.dll</buildargs>
        <buildtimeoutseconds>900</buildtimeoutseconds>
      </exec>
    </tasks>    
  </project>
</cruisecontrol>
 
But i got output as shown below:
<pre><buildresults>
  <message>NUnit version 2.5.10.11092</message>
  <message>Copyright (C) 2002-2009 Charlie Poole.</message>
  <message>Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.</message>
  <message>Copyright (C) 2000-2002 Philip Craig.</message>
  <message>All Rights Reserved.</message>
  <message>Runtime Environment - </message>
  <message>   OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1</message>
  <message>  CLR Version: 2.0.50727.5446 ( Net 2.0 )</message>
  <message>ProcessModel: Default    DomainUsage: Single</message>
  <message>Execution Runtime: Default</message>
  <message>....</message>
  <message>Tests run: 4, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0.0420025 seconds</message>
  <message>  Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0</message>
</buildresults>
 
Please tell me is this correct output generated from NCover. If not please let me know solution.
Posted 10 Oct '11 - 21:46
skumarn634

Comments
Reiss - 11 Oct '11 - 7:34
OT : In a command window cd \ will return you to the root folder

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 365
1 OriginalGriff 315
2 Slacker007 240
3 Dave Kreskowiak 212
4 Aarti Meswania 210
0 Sergey Alexandrovich Kryukov 8,893
1 OriginalGriff 7,134
2 CPallini 3,678
3 Rohan Leuva 3,036
4 Maciej Los 2,428


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 11 Oct 2011
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid