Klaus Lindemann - 2009-05-01

Hi

I am trying out part cover with NUnit, but I am having trouble getting any results displayed.

I have written a very simple test (see below) and I am running it via partcover like this:

C:\tmp\PCTest\PCTest\bin\Debug>"\Program Files\Gubka Bob\PartCover .NET 2.3"\PartCover --target-work-dir . --target "\Program Files\NUnit 2.4.8\bin\nunit-console.exe" --target-args .\PCTest.dll --include [*]* --exclude [nunit*]* --log 0 --output cov.xml

The file cov.xml contains this:

<PartCoverReport date="2009-05-01T14:26:38.9485998+02:00">
<File id="1" url="C:\tmp\PCTest\PCTest\KVL_Class.cs" />
</PartCoverReport>

and I get the following output on the console:

C:\tmp\PCTest\PCTest\bin\Debug>"\Program Files\Gubka Bob\PartCover .NET 2.3"\Par
tCover --target-work-dir . --target "\Program Files\NUnit 2.4.8\bin\nunit-consol
e.exe" --target-args .\PCTest.dll --include [*]* --exclude [nunit*]* --log 0 --o
utput cov.xml
open driver pipe
modify target environment variables
create target process
wait for driver connection
driver connected successfully
send rules to the driver
Target PageFaultCount: 1095
Target PagefileUsage: 2424832
Target PeakPagefileUsage: 2424832
Target PeakWorkingSetSize: 4407296
Target QuotaNonPagedPoolUsage: 3064
Target QuotaPagedPoolUsage: 108128
Target QuotaPeakNonPagedPoolUsage: 3112
Target QuotaPeakPagedPoolUsage: 108216
Target WorkingSetSize: 4407296
wait for rules confirm
[00000] [07840] Options dump:
[00000] [07840]   VerboseLevel: 0
[00000] [07840]   Log file: C:\tmp\PCTest\PCTest\ [00000] [07840]   Log pipe: yes
[00000] [07840]   Count Coverage - ON
[00000] [07840]   Count Call Tree - OFF
[00000] [07840]   Exclude [nunit*]*
[00000] [07840]   Exclude [mscorlib]*
[00000] [07840]   Exclude [System*]*
[00000] [07840]   Include [*]*
NUnit version 2.4.8
Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment -
   OS Version: Microsoft Windows NT 6.0.6001 Service Pack 1
  CLR Version: 2.0.50727.3074 ( Net 2.0.50727.3074 )

.

Tests run: 1, Failures: 0, Not run: 0, Time: 0.025 seconds

instrument data is being received
InstrumentDataReceiveCountersBegin
assembly count: 0
InstrumentDataReceiveCountersEnd
file list is being received
1 files to load
file list load is complete
skip list is being received
8702 skip items to load
skip list load is complete
instrument data load complete
functions loading is being started
functions count 0
functions loading is complete
Target PageFaultCount: 7632
Target PagefileUsage: 22482944
Target PeakPagefileUsage: 22482944
Target PeakWorkingSetSize: 26746880
Target QuotaNonPagedPoolUsage: 8684
Target QuotaPagedPoolUsage: 198392
Target QuotaPeakNonPagedPoolUsage: 12668
Target QuotaPeakPagedPoolUsage: 203288
Target WorkingSetSize: 26746880
request target shutdown

What am I missing here? Why don't my test code show up in the coverage report?

Thanks in advance.
- Klaus

--------------------------------------------- Test code -------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace PCTest
{
  public class KVL_Class
  {
    string val = "";

    public KVL_Class(string v)
    {
      val = v;
    }

    public string getVal()
    {
      return val;
    }
  }

  [TestFixture]
  public class Test
  {
    [Test]
    public void DoTest()
    {
      KVL_Class kc = new KVL_Class("Erik");
      Console.WriteLine("");

      Assert.AreEqual("Erik", kc.getVal());
    }

  }
}