Welcome to the latest Clover.NET alpha snapshot.
The zip file for Clover.NET contains three installers. One installer, VSIP Interop Assembly Redist.msi, is provided by Microsoft and includes a number of interop assemblies to expose core Visual Studio functionality to managed code. This must be installed before the Clover VS.NET plugin will be functional.
The two remaining are for different Clover installs. One installs the Clover.NET command line tools, whilst the other also installs the Clover.NET visual studio plugin.
The Clover.NET plugin works with Visual Studio.NET 2003.
The Clover.NET install includes a samples directory with a very basic sample project, Sample. The Sample dll project comes with a Sample.sln solution file. The following steps show how to Clover this project with the VS.NET plugin
![]() |
A toggle button to control display of coverage information in the VS.NET editor |
![]() |
Clover and build the current solution |
![]() |
load the latest coverage information |
![]() |
Clean coverage information (Not implemented) |
The following steps show how to use Clover.NET's command line tools to Clover the Sample project mentioned above.
CloverInstr -i sample.cdb -s Sample -d InstSample
HtmlReporter -i sample.cdb -o report -t "Test Report"
At the end of the above process there will be an HTML coverage report in the "report" directory. That's all there is to Clovering your projects. While this is a simple project, the same principles can be used for more complex projects. An alternative it to add the Clovered source code as a separate project in your main Visual Studio solution and build alongside the non-Clovered code.
Clovering and building takes place on the main UI thread. For a large project, the UI may be unresponsive while this occurs.
When running a Clover build, the Clover plugin spawns an external instance of Visual Studio (devenv) to do the build. This is done to ensure this build does not interfere with the state of the current solution. If build errors, as opposed to Clovering errors, occur, the build will finish with the task list but the task list may be empty, since the external errors are not currently parsed. If this is the case, please refer to the build output window for more information.
You can generate an HTML report of VS.NET Clovered projects using the command line tool. The collected data is the same regardless of how the coverage was generated. Conversely, you can view coverage in the VS.NET IDE for projects built and run using the command line tools
Clover.NET hooks the AppDomain Unload event to trigger writing out coverage information. The csUnit test runner will not always unload an assembly when it quits, resulting in no coverage information being written. A workaround is to rerun the unit test. This causes csUnit to Unload the currently AppDomain and assembly before starting the next test run. This unloading is sufficient to write out the coverage information. In fact the second test run can be stopped straight away as the coverage information from the first run will have been saved. A bug has been reported to the csUnit project.
Clover.NET parses preprocessor directives but does not act upon them. This may affect Clover.NET's ability to parse a source file with preprocessor directives. If, ignoring the directives, the resulting source file is syntactically correct, Clover.NET will instrument the code correctly. Otherwise, Clover.NET will report a syntax error. The use of file level #if ... #endif constructs should, therefore, be OK. More complete preprocessor support is planned.
The instrumenter supports three debugging command line options
The verbose setting gives you more information on what the instrumenter is doing as it goes. This should help locate any files that cause problems. If you do encounter an issue where the Instrumenter does not correctly instrument your code or crashes, please rerun the instrumenter, firstly with debug and then trace settings. For example, on the sample project
CloverInstr -i sample.cdb -s Sample -d InstSample --trace > trace.txt
CloverInstr -i sample.cdb -s Sample -d InstSample --debug > debug.txt
If you want to instrument a single file, use the following example as a guide:
CloverInstr -i sample.cdb -d InstSample --debug Sample\SampleClass.cs > debug.txt
Please report such errors and include the debug.txt and trace.txt files. If you can include the source files as well, that would be appreciated. Only the source files which cause problems are required.
Note: Please be aware that the trace operation generates extremely large output as it tracks the parser states.
We are interested in all feedback. Please feel free to express you thoughts on any aspect of Clover.NET. If you run into a problem, please try to let us know as much as you can. We are particularly interested when instrumentation generates code which fails to compile. If you can send us the offending code, that would be great. We realize you cannot always send in code, for whatever reasons, so in these cases we would appreciate as much information as you are comfortable sending.
For any issues, just email clover-support@thecortex.net with the details.
We have also created a set of Clover.NET fora on our forum system. You can use this to discuss issues with the current alpha. The Clover.NET fora are available here