Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 161 lines (117 sloc) 5.294 kb
cb203a9 Zoltan Varga Initial revision
vargaz authored
1
9130e4e Zoltan Varga 2009-01-08 Zoltan Varga <vargaz@gmail.com>
vargaz authored
2 0. STATUS
3 ---------
4
5 This package is currently unmaintained, if you use it, you are on your own.
6
cb203a9 Zoltan Varga Initial revision
vargaz authored
7 1. INTRODUCTION
8 ---------------
9
700a359 Paolo Molaro Fri Nov 24 16:25:51 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
10 MonoCov is a line coverage analysis program for mono. It can be used to
cb203a9 Zoltan Varga Initial revision
vargaz authored
11 display coverage data collected while running a .NET program. There are two
700a359 Paolo Molaro Fri Nov 24 16:25:51 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
12 parts in the tool: a profiler module which is used during the execution of
13 the program you want to gather coverage data from and a Gtk# user interface.
cb203a9 Zoltan Varga Initial revision
vargaz authored
14
15 1.5 REQUIREMENTS
16 ----------------
17
700a359 Paolo Molaro Fri Nov 24 16:25:51 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
18 Recent Mono and Gtk# releases. You also need Mono.Cecil installed
d8805b6 Paolo Molaro Thu Nov 30 12:15:03 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
19 or copied in the source dir and where the programs are run from.
20 The source release contains Mono.Cecil.dll and make install takes
21 care of installing it properly.
cb203a9 Zoltan Varga Initial revision
vargaz authored
22
23 2. USAGE
24 --------
25
26 2.1 COVERAGE DATA COLLECTION
27 ----------------------------
28
47c4264 * Makefile: Fixed clean target.
Jacob Ilsø Christensen authored
29 To produce coverage info for an .NET program, compile it with the -debug
cb203a9 Zoltan Varga Initial revision
vargaz authored
30 switch to generate debug information. After this, run the program as follows:
31
700a359 Paolo Molaro Fri Nov 24 16:25:51 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
32 $ mono --debug --profile=monocov prog.exe
cb203a9 Zoltan Varga Initial revision
vargaz authored
33
34 This will produce a coverage data file called prog.exe.cov. You can run the
35 analyser program as follows:
36
700a359 Paolo Molaro Fri Nov 24 16:25:51 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
37 $ mono monocov.exe prog.exe.cov
cb203a9 Zoltan Varga Initial revision
vargaz authored
38
39 This will display the class hierarchy of the program with the corresponding
40 coverage information.
41
42 It is also possible to filter the list of classes which need coverage data
43 generated. Filters are string which are applied agains the fully qualified
44 names of classes, e.g. [assemblyname]classname. You can specify filters
45 directly on the command line:
46
700a359 Paolo Molaro Fri Nov 24 16:25:51 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
47 $ mono --debug --profile=monocov:-Security,-[System.Xml] prog.exe
cb203a9 Zoltan Varga Initial revision
vargaz authored
48
49 There are two types of filters: include filters, whose name begins with '+',
50 and exclude filters, whose name begins with '-'. Include filters are checked
51 before exclude filters.
52
53 For example:
54
700a359 Paolo Molaro Fri Nov 24 16:25:51 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
55 $ mono --debug --profile=monocov:+[mscorlib],-Hashtable prog.exe
cb203a9 Zoltan Varga Initial revision
vargaz authored
56
57 This will collect coverage info for all classes in corlib, except the ones
58 whose name contains 'Hashtable'.
59
60 2.2 ANALYSIS
61 ------------
62
700a359 Paolo Molaro Fri Nov 24 16:25:51 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
63 The collected coverage data can be browsed using the monocov program.
cb203a9 Zoltan Varga Initial revision
vargaz authored
64 This program will read the data file produced by the profiler module, and
65 display its contents in a hierarchical fashion.
66 It is also possible to export the contents of a data file into XML, which
67 can be viewed in an XSL capable browser like mozilla.
68 To export the data as XML, run monocov like this:
700a359 Paolo Molaro Fri Nov 24 16:25:51 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
69 monocov --export-xml=<DEST DIR> <DATA FILE NAME>
cb203a9 Zoltan Varga Initial revision
vargaz authored
70
71 The generated XML files use a default stylesheet which is a bit ugly. It would
72 be good if somebody could contribute a better one :)
73
d8805b6 Paolo Molaro Thu Nov 30 12:15:03 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
74 To export the data as HTML, run monocov like this:
75 monocov --export-html=<DEST DIR> <DATA FILE NAME>
76
2e4cfc9 Andreas Windischer The application will return an exit code which can be used to determine
alpinechough authored
77 You can use this application to track your code coverage as part of your build
78 process. To specify a minimum methode coverage of 50% and a minimum class coverage
79 of 80%:
86990f9 Andreas Windischer Example bugfix.
alpinechough authored
80 monocov --minMethodeCoverage=0.5 --minClassCoverage=0.8 <DATA FILE NAME>
2e4cfc9 Andreas Windischer The application will return an exit code which can be used to determine
alpinechough authored
81
82 The application will return an exit code which can be used to determine if all
83 classes/methodes have a greater code coverage than specified.
84
cb203a9 Zoltan Varga Initial revision
vargaz authored
85 2.5 KNOWN BUGS
86 --------------
87
d8805b6 Paolo Molaro Thu Nov 30 12:15:03 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
88 The --debug option to mono should not be required and it should be enabled
89 by default.
57cbc81 Paolo Molaro Thu Nov 30 17:36:43 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
90 We disable mono's domain unload since we don't handle that case yet.
cb203a9 Zoltan Varga Initial revision
vargaz authored
91
92 3. UTILITY PROGRAMS
93 -------------------
94
95 There are two utility programs included with MonoCov:
96
97 - symbols.exe: this program can be used to dump the line number information
98 contained in an mcs generated assembly.
99
100 - nunit-console.exe: this is a rewritten version of the original nunit console
101 program. It has the following features:
102 - easier to invoke: no stupid /assembly and /fixture arguments
103 - ability to run test fixtures whose name matches a given pattern, like
104 all the System.IO tests.
105 - ability to exclude tests whose name matches a given pattern.
106 - display of more detailed progress information.
107
108 4. TODO
109 -------------
110
111 - Add ability to run the program from inside the analyzer
112 - Add filters (globals/per program)
113 - Handle nested classes more intelligently
114
115 5. LICENSE
116 ----------
117
3ca6ee4 Zoltan Varga Fix license description in README file.
vargaz authored
118 MIT/X11, see LICENSE file.
cb203a9 Zoltan Varga Initial revision
vargaz authored
119
120 6. CONTACT
121 ----------
122
47c4264 * Makefile: Fixed clean target.
Jacob Ilsø Christensen authored
123 Zoltan Varga (vargaz@freemail.hu)
124 Jacob Ilsø Christensen (jacobilsoe@gmail.com)
d8805b6 Paolo Molaro Thu Nov 30 12:15:03 CET 2006 Paolo Molaro <lupus@ximian.com>
illupus authored
125 or preferably
955bb82 Zoltan Varga 2003-07-02 Zoltan Varga <vargaz@freemail.hu>
vargaz authored
126 the mono devel list (mono-devel-list@ximian.com)
cb203a9 Zoltan Varga Initial revision
vargaz authored
127
128 RANDOM NOTES:
129 -------------
130
131 - Methods with strange debugging info:
132 - System.Collections.Hashtable..cctor()
133 - SortedList+SynchedSortedList::this [key]
134 - SortedList+SynchedSortedList::Clear ()
135 - System.Text.RegularExpressions.Capture
136
137 - If trans.gif is missing from the export directory:
138 - when viewing HTML, it doesn't matter
139 - when viewing XML, it matters
140
141 - How can a bar be created without using an image ?
142
143 TODO:
144 - Add private paths used during data collection to the paths used to search for
145 assemblies.
146 - add 'include' and 'exclude' to filters
147 - Implement merging of coverage results
148 - put namespaces above classes in the hierarchy
149 - handle missing source files
150 - Scintilla
151 - html output (with XSLT)
152 - use Xml serialization in SyntaxHighlighter
153 - speed up test suite generation in nunit (or in mono)
154 - namespaces & filtering ???
155 - fix StackTrace tests
156 - add ability to exclude some appdomains (like the nunit main appdomain)
157 so the tests will run faster.
158 - avoid instrumentation for instruction without side effects (like ldc.i4)
159 - why does the RSA tests take so much time -> because of entropy generation
5b48528 Zoltan Varga 2004-04-15 Zoltan Varga <vargaz@freemail.hu>
vargaz authored
160
Something went wrong with that request. Please try again.