spicycode / rcov

Home has moved to http://github.com/relevance/rcov

This URL has Read+Write access

spicycode (author)
Fri Sep 12 07:35:41 -0700 2008
commit  9ad200c54372fcbf139af77b7f453aca6bfb7f35
tree    99590a671195f596f756a76588c5f5241816a652
parent  cdbec19579ef294dbb502c86c9b0158a2cc990e1
rcov / readme_for_emacs
100644 65 lines (44 sloc) 2.235 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
<tt>rcov.el</tt> allows you to use rcov from Emacs conveniently.
* Run unit tests and jump to uncovered code by <tt>C-x `</tt>.
* Run unit tests and save the current coverage status.
* Run unit tests and jump to uncovered code introduced since the last run.
* View cross-reference annotated code.
 
== Installation
 
Copy <tt>rcov.el</tt> to the appropriate directory, which is in load-path.
Then require it.
  (require 'rcov)
 
 
== Usage
 
There are some commands to run rcov in Emacs.
All of them displays +rcov+ window, whose major-mode is compilation-mode.
Therefore you can jump to uncovered code by <tt>C-x `</tt>.
 
+rcov-command-line+, +rcovsave-command-line+, and +rcovdiff-command-line+ define
command line to run rcov.
If you do not use +rcov+ from Rake, you must modify them.
 
=== Finding uncovered code
 
Type the following while editing your program:
  M-x rcov
  
=== Setting the reference point
 
+rcov+'s <tt>--text-coverage-diff</tt> mode compares the current coverage status against
the saved one. It therefore needs that information to be recorded
before you write new code (typically right after you perform a commit) in
order to have something to compare against.
 
You can save the current status with the <tt>--save</tt> option.
 
Type the following to save the current status in Emacs:
  M-x rcovsave
If you do not use +rcov+ from Rake, you must modify +rcovsave-command-line+ variable.
 
=== Finding new uncovered code
 
Type the following to save the current status in Emacs:
  M-x rcovdiff
 
=== Viewing cross-reference annotated code
 
If you read cross-reference annotated code, issue
  rake rcov RCOVOPTS='-a'
at the beginning.
This command creates +coverage+ directory and many *.rb files in it.
Filenames of these Ruby scripts are converted from original path.
You can browse them by normally <tt>C-x C-f</tt>.
You can think of <tt>-a</tt> option as <tt>--xrefs</tt> option and output format is Ruby script.
 
After find-file-ed annotated script, the major-mode is rcov-xref-mode,
which is derived from ruby-mode and specializes navigation.
 
<tt>Tab</tt> and <tt>M-Tab</tt> goes forward/backward links.
<tt>Ret</tt> follows selected link.
 
This feature is useful to read third-party code or to follow control flow.