Using NUNIT with DPS 7.X



Using Nunit with DPS 7.2


Many developers are using the unit testing tool NUnit as the test harness for executing and testing the classes they have written. This guide provides instructions on the various ways in which DevPartner version 7.2 can be used in conjunction with NUnit to obtain Memory, Performance and Coverage information .

DevPartner Standalone (this applies to Coverage/Performance Analysis)

  1. From the Start menu navigate to Coverage/Performance Analysis (Start > Programs > Compuware DevPartner Studio).
  2. Load the preferred Anaysis type.
  3. From within Coverage/Performance go to the File menu, and navigate to the nunit-gui.exe process, and open it (you may have to modify the file type to show all files).
  4. Inside Coverage/Performance click on the Run button "F5".
  5. Use NUnit-Gui as normal and upon exit you will see coverage/performance information Inside Visual Studio IDE (applies to Coverage/Performance/Memory Analysis).

To use our tools with NUnit inside Visual Studio, the process has to be started when you run your project so we can hook onto it.

  1. Right click on your project and select Properties.
  2. Select the configuration you want (e.g. "Active(Debug)").
  3. Select the "Configuration Properties" and "Debugging".
  4. Where you see the "Start Action" label, select "Start external program", then click on the ellipse "..." and navigate to nunit-gui.exe.
  5. Where you see the label "Start Options", for the Command line arguments enter the name of your dll (e.g. mytest.dll). Then set the working directory to the bin location for your dll.
  6. Click apply, and run your application in debug mode as normal.

Command Line (applies to Coverage/Performance Analysis)

Coverage and Performance can be driven from the command line, so you can setup a batch process to launch either NUnit-Gui or NUnit-Console.

The binaries for Coverage and Performance are located in the Analysis directory (e.g. "C:\Program Files\Compuware\DevPartner Studio\Analysis") and are called TCDev.exe (coverage) and TTDev.exe (performance).

Example Command line:

TCDev /R path unit-gui.exe

This example will load NUnit-Gui and run it immediately. For more options type TCDev /?

Note: For Coverage, Performance and Memory Analysis to work the project being analysed must be a debug build. If for any reason you do not see any results for your project check this first.
Old KB# 10979
Comment List
Related Discussions