Find file
Fetching contributors…
Cannot retrieve contributors at this time
106 lines (105 sloc) 3.62 KB
.TH "monocov" 1
monocov \- Mono Coverage Viewer
.B monocov
[options] [coverage-file]
.I \--export-xml=VALUE
Export coverage data as XML into specified directory
.I \--export-html=VALUE
Export coverage data as HTML into specified directory
.I \--stylesheet=VALUE
Use the specified XSL stylesheet for XML->HTML conversion
.I \--minClassCoverage=VALUE
If a code coverage of a class is less than specified, the application exits with return code 1
.I \--minMethodeCoverage=VALUE
If a code coverage of a methode is less than specified, the application exits with return code 1
.I \--no-progress
No progress messages during the export process
MonoCov is a line coverage analysis program for mono. It can be used to
display coverage data collected while running a .NET program. There are two
parts in the tool: a profiler module which is used during the execution of
the program you want to gather coverage data from and a Gtk# user interface.
.SS Coverage Data Collection
To produce coverage info for an .NET program, compile it with the -debug
switch to generate debug information. After this, run the program as follows:
mono --debug --profile=monocov prog.exe
This will produce a coverage data file called prog.exe.cov. You can run the
analyser program as follows:
mono monocov.exe prog.exe.cov
This will display the class hierarchy of the program with the corresponding
coverage information.
It is also possible to filter the list of classes which need coverage data
generated. Filters are string which are applied agains the fully qualified
names of classes, e.g. [assemblyname]classname. You can specify filters
directly on the command line:
mono --debug --profile=monocov:-Security,-[System.Xml] prog.exe
There are two types of filters: include filters, whose name begins with '+',
and exclude filters, whose name begins with '-'. Include filters are checked
before exclude filters.
For example:
mono --debug --profile=monocov:+[mscorlib],-Hashtable prog.exe
This will collect coverage info for all classes in corlib, except the ones
whose name contains 'Hashtable'.
.SS Analysis
The collected coverage data can be browsed using the monocov program.
This program will read the data file produced by the profiler module, and
display its contents in a hierarchical fashion.
It is also possible to export the contents of a data file into XML, which
can be viewed in an XSL capable browser like mozilla.
To export the data as XML, run monocov like this:
monocov --export-xml=<DEST DIR> <DATA FILE NAME>
The generated XML files use a default stylesheet which is a bit ugly. It would
be good if somebody could contribute a better one :)
To export the data as HTML, run monocov like this:
monocov --export-html=<DEST DIR> <DATA FILE NAME>
You can use this application to track your code coverage as part of your build
process. To specify a minimum methode coverage of 50% and a minimum class coverage
of 80%:
monocov --minMethodeCoverage=0.5 --minClassCoverage=0.8 <DATA FILE NAME>
The application will return an exit code which can be used to determine if all
classes/methodes have a greater code coverage than specified.
The --debug option to mono should not be required and it should be enabled
by default.
We disable mono's domain unload since we don't handle that case yet.
Copyright (c) 2003, 2004, 2005 The Mono Project
License: MIT/X11, see LICENSE file.
Visit for details.
Visit for details