rcov 0.5.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/BLURB ADDED
@@ -0,0 +1,117 @@
1
+
2
+ Source code, additional information, screenshots... available at
3
+ http://eigenclass.org/hiki.rb?rcov
4
+ Release information:
5
+ http://eigenclass.org/hiki.rb?rcov+0.5.0
6
+
7
+ If you're on win32, you can also find a pre-built rcovrt.so (which makes
8
+ code coverage analysis >100 times faster) in the above-mentioned pages.
9
+
10
+ Overview
11
+ ========
12
+ rcov is a code coverage tool for Ruby. It is commonly used for viewing overall
13
+ test coverage of target code. It features:
14
+ * fast execution: 20-300 times faster than previous tools
15
+ * multiple analysis modes: standard, bogo-profile, "intentional testing",
16
+ dependency analysis...
17
+ * fairly accurate coverage information through code linkage inference using
18
+ simple heuristics
19
+ * cross-referenced XHTML and several kinds of text reports
20
+ * support for easy automation with Rake and Rant
21
+ * colorblind-friendliness
22
+
23
+ How do I use it?
24
+ ================
25
+
26
+ In the common scenario, your tests are under test/ and the target code
27
+ (whose coverage you want) is in lib/. In that case, all you have to do is
28
+ use rcov to run the tests (instead of testrb), and a number of XHTML files
29
+ with the code coverage information will be generated, e.g.
30
+
31
+ rcov -Ilib test/*.rb
32
+
33
+ will execute all the .rb files under test/ and generate the code coverage
34
+ report for the target code (i.e. for the files in lib/) under coverage/. The
35
+ target code needs not be under lib/; rcov will detect is as long as it is
36
+ require()d by the tests. rcov is smart enough to ignore "uninteresting"
37
+ files: the tests themselves, files installed in Ruby's standard locations,
38
+ etc. See rcov --help for the list of regexps rcov matches filenames
39
+ against.
40
+
41
+ rcov can also be used from Rake; see README.rake or the RDoc documentation
42
+ for more information.
43
+
44
+ rcov can output information in several formats, and perform different kinds
45
+ of analyses in addition to plain code coverage. See rcov --help for a
46
+ description of the available options.
47
+
48
+ Sample output
49
+ =============
50
+
51
+ See http://eigenclass.org/hiki.rb?rcov (once again) for screenshots.
52
+
53
+ The text report (also used by default in RcovTasks) resembles
54
+
55
+
56
+ +-----------------------------------------------------+-------+-------+--------+
57
+ | File | Lines | LOC | COV |
58
+ +-----------------------------------------------------+-------+-------+--------+
59
+ |lib/rcov.rb | 572 | 358 | 91.3% |
60
+ +-----------------------------------------------------+-------+-------+--------+
61
+ |Total | 572 | 358 | 91.3% |
62
+ +-----------------------------------------------------+-------+-------+--------+
63
+ 91.3% 1 file(s) 572 Lines 358 LOC
64
+
65
+
66
+
67
+ The (undecorated) textual output with execution count information looks like this:
68
+
69
+ $ rcov --no-html --text-counts b.rb
70
+ ================================================================================
71
+ ./b.rb
72
+ ================================================================================
73
+ | 2
74
+ a, b, c = (1..3).to_a | 2
75
+ 10.times do | 1
76
+ a += 1 | 10
77
+ 20.times do |i| | 10
78
+ b += i | 200
79
+ b.times do | 200
80
+ c += (j = (b-a).abs) > 0 ? j : 0 | 738800
81
+ end | 0
82
+ end | 0
83
+ end | 0
84
+
85
+
86
+ License
87
+ -------
88
+ rcov is released under the terms of Ruby's license.
89
+ rcov includes xx 0.1.0, which is subject to the following conditions:
90
+
91
+ ePark Labs Public License version 1
92
+ Copyright (c) 2005, ePark Labs, Inc. and contributors
93
+ All rights reserved.
94
+
95
+ Redistribution and use in source and binary forms, with or without modification,
96
+ are permitted provided that the following conditions are met:
97
+
98
+ 1. Redistributions of source code must retain the above copyright notice, this
99
+ list of conditions and the following disclaimer.
100
+ 2. Redistributions in binary form must reproduce the above copyright notice,
101
+ this list of conditions and the following disclaimer in the documentation
102
+ and/or other materials provided with the distribution.
103
+ 3. Neither the name of ePark Labs nor the names of its contributors may be
104
+ used to endorse or promote products derived from this software without
105
+ specific prior written permission.
106
+
107
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
108
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
109
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
110
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
111
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
112
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
113
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
114
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
115
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
116
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
117
+
data/CHANGES ADDED
@@ -0,0 +1,75 @@
1
+
2
+ User-visible changes.
3
+
4
+ Since 0.4.0 (2006-05-22)
5
+ ========================
6
+ Features
7
+ --------
8
+ * ability to create cross-referenced reports, indicating where methods are
9
+ called from (--callsites)
10
+ * more refinements in the heuristics: now several kinds of multi-line quoted
11
+ strings are handled properly
12
+ * --include-file to specify files not to be ignored in the report(s)
13
+ * implemented a task generator for Rant
14
+
15
+ Bugfixes
16
+ --------
17
+ * corrected the LOC counts in the XHTML summaries
18
+ * pure-Ruby tracing module works again; was broken in 0.4.0
19
+ * RcovTask#ruby_opts fixed; they were being passed to rcov instead of ruby
20
+ * solved the DOCTYPE issue (it'd get put at the end of the file under some
21
+ Ruby versions)
22
+
23
+ Minor enhancements
24
+ ------------------
25
+ * slightly more readable XHTML reports, esp. for IE
26
+ * text reports fit in 79 columns so they look OK with cmd.exe
27
+ * try to guide the user when all files were considered "uninteresting" by rcov
28
+ * the output_dir is preserved in RcovTasks when the user specifies --profile
29
+ via the RCOVOPTS env. var.
30
+
31
+ Since 0.3.0 (2006-05-05)
32
+ ========================
33
+
34
+ Features
35
+ --------
36
+ * easy automation via Rake using the bundled Rcov::RcovTask
37
+ * better heuristics: supports heredocs at last, including variants your editor
38
+ is probably unable to handle, and =begin/=end comments
39
+ * --rails option to ignore files under vendor/, enviroment/ and config/
40
+ * parts of the runtime exposed and documented for external use
41
+ * new color scheme, with alternating shades of the base colors
42
+ * -w to set $VERBOSE=true (turns on warnings)
43
+ * --text-report and --text-summary
44
+ * --sort and --sort-reverse for the summaries and reports
45
+ * --threshold and --only-uncovered
46
+ * --replace-progname
47
+
48
+ Backwards incompatible changes
49
+ ------------------------------
50
+ * renamed --text to --text-counts and --rich-text to --text-coverage: they
51
+ were misnamed to begin with
52
+ * changed the meaning of -t and -T (--text-summary and --text-report)
53
+ * $0 is not changed by default for each loaded file anymore; the old
54
+ behavior (modulo a small bugfix) can be reproduced with --replace-progname
55
+
56
+ Since 0.2.0 (2006-02-25)
57
+ ========================
58
+
59
+ Features
60
+ --------
61
+ * --exclude-only
62
+ * consolidate multiple references to the same underlying .rb file
63
+ (much needed for Rails)
64
+ * --test-unit-only
65
+
66
+ Fixes
67
+ -----
68
+ * consider and/op operators
69
+ * honor --no-color in (rich) text mode
70
+ * output valid XHTML indices
71
+
72
+ Since 0.1.0
73
+ ===========
74
+ Tons. Better output, MUCH faster (two orders of magnitude), better command
75
+ line...
data/LEGAL ADDED
@@ -0,0 +1,36 @@
1
+
2
+ LEGAL NOTICE
3
+ ------------
4
+
5
+ rcov itself is subject to the terms specified in LICENSE.
6
+
7
+ rcov includes (in the DATA area) xx-0.1.0, which can be redistributed
8
+ and used under the following conditions:
9
+
10
+
11
+ ePark Labs Public License version 1
12
+ Copyright (c) 2005, ePark Labs, Inc. and contributors
13
+ All rights reserved.
14
+
15
+ Redistribution and use in source and binary forms, with or without modification,
16
+ are permitted provided that the following conditions are met:
17
+
18
+ 1. Redistributions of source code must retain the above copyright notice, this
19
+ list of conditions and the following disclaimer.
20
+ 2. Redistributions in binary form must reproduce the above copyright notice,
21
+ this list of conditions and the following disclaimer in the documentation
22
+ and/or other materials provided with the distribution.
23
+ 3. Neither the name of ePark Labs nor the names of its contributors may be
24
+ used to endorse or promote products derived from this software without
25
+ specific prior written permission.
26
+
27
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
28
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
31
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
34
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/LICENSE ADDED
@@ -0,0 +1,56 @@
1
+ rcov is copyrighted free software by Mauricio Fernandez <mfp@acm.org>.
2
+ You can redistribute it and/or modify it under either the terms of the GPL
3
+ (see the file GPL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a) place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c) give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d) make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a) distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b) accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c) give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d) make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
@@ -0,0 +1,42 @@
1
+
2
+ = +rcov+
3
+
4
+ +rcov+ is a:
5
+ 1. tool for code coverage analysis for Ruby
6
+ 2. library for collecting code coverage and execution count information
7
+ introspectively
8
+
9
+ If you want to use the command line tool, the output from
10
+ rcov -h
11
+ is self-explicative.
12
+
13
+ If you want to automate the execution of +rcov+ via Rake or Rant, take a look at
14
+ README.rake[link:files/README_rake.html] or
15
+ README.rant[link:files/README_rant.html], respectively.
16
+
17
+ If you want to use the associated library, read on.
18
+
19
+ == Usage of the +rcov+ runtime/library
20
+
21
+ +rcov+ is primarily a tool for code coverage analysis, but since 0.4.0 it
22
+ exposes some of its code so that you can build on top of its heuristics for
23
+ code analysis and its capabilities for coverage information and execution
24
+ count gathering.
25
+
26
+ The main classes of interest are Rcov::FileStatistics,
27
+ Rcov::CodeCoverageAnalyzer and Rcov::CallSiteAnalyzer.
28
+
29
+ Rcov::FileStatistics can use some heuristics to determine
30
+ which parts of the file are executable and which are mere comments.
31
+
32
+ Rcov::CodeCoverageAnalyzer is used to gather code coverage and execution
33
+ count information inside a running Ruby program.
34
+
35
+ Rcov::CallSiteAnalyzer is used to obtain information about where methods are
36
+ defined and who calls them.
37
+
38
+ The parts of +rcov+'s runtime meant to be reused (i.e. the external API) are
39
+ documented with RDoc. Those not meant to be used are clearly marked as so or
40
+ were deliberately removed from the present documentation.
41
+
42
+
@@ -0,0 +1,128 @@
1
+ rcov copyright (c) 2004-2006 Mauricio Fernandez <mfp@acm.org>
2
+ rcov includes xx 0.1.0, copyright (c) 2005, ePark Labs, Inc. and contributors
3
+
4
+ rcov README
5
+ ============
6
+
7
+ rcov is a code coverage tool for Ruby. It is commonly used for viewing
8
+ overall test coverage of target code. It features:
9
+ * fast execution: 20-300 times faster than previous tools
10
+ * multiple analysis modes: standard, bogo-profile, "intentional testing",
11
+ dependency analysis...
12
+ * fairly accurate coverage information through code linkage inference using
13
+ simple heuristics
14
+ * cross-referenced XHTML and several kinds of text reports
15
+ * support for easy automation with Rake and Rant
16
+ * colorblind-friendliness
17
+
18
+ Requirements
19
+ ------------
20
+
21
+ * Ruby 1.8
22
+ * (recommended) C compiler: you can also use rcov without the rcovrt
23
+ extension but rcov will be two orders of magnitude slower. The extension
24
+ requires Ruby 1.8.3 or later.
25
+ If you're on win32, you can find a pre-built rcovrt extension at
26
+ http://eigenclass.org/hiki.rb?rcov
27
+
28
+
29
+ Normal install
30
+ --------------
31
+
32
+ De-compress the archive and enter its top directory.
33
+ Then type:
34
+
35
+ ($ su)
36
+ # ruby setup.rb
37
+
38
+ This simple step installs rcov under the default location for Ruby
39
+ libraries. You can also customize the installation by supplying some
40
+ options to setup.rb.
41
+ Try "ruby setup.rb --help".
42
+
43
+ A normal (rcovrt-enabled) install requires Ruby >= 1.8.3 and a working C
44
+ toolchain; if you cannot compile Ruby extensions proceed as described below.
45
+
46
+ If you're on win32, you can find a pre-built rcovrt extension at
47
+ http://eigenclass.org/hiki.rb?rcov
48
+
49
+ You might have to install a "development package" (often named ruby-dev or
50
+ ruby1.8-dev), or alternatively build ruby from the sources, if the compiler
51
+ cannot find the headers (ruby.h and friends).
52
+
53
+ Install without the rcovrt extension
54
+ ------------------------------------
55
+
56
+ ($su )
57
+ # ruby setup.rb all --without-ext
58
+
59
+ will install rcov without building the rcovrt extension.
60
+
61
+ Usage
62
+ -----
63
+
64
+ In the common scenario, your tests are under test/ and the target code
65
+ (whose coverage you want) is in lib/. In that case, all you have to do is
66
+ use rcov to run the tests (instead of testrb), and a number of XHTML files
67
+ with the code coverage information will be generated, e.g.
68
+
69
+ rcov -Ilib test/*.rb
70
+
71
+ will execute all the .rb files under test/ and generate the code coverage
72
+ report for the target code (i.e. for the files in lib/) under coverage/. The
73
+ target code needs not be under lib/; rcov will detect is as long as it is
74
+ require()d by the tests. rcov is smart enough to ignore "uninteresting"
75
+ files: the tests themselves, files installed in Ruby's standard locations,
76
+ etc. See rcov --help for the list of regexps rcov matches filenames
77
+ against.
78
+
79
+ rcov can also be used from Rake; see README.rake or the RDoc documentation
80
+ for more information. The Rakefile included in rcov's sources holds a few
81
+ tasks that run rcov on itself, producing a number of reports. You can try
82
+ rake rcov
83
+ preferably after a full install or
84
+ ruby setup.rb config
85
+ ruby setup.rb setup
86
+ so that the rcovrt extension can be used to speed up the process.
87
+ This will generate a cross-referenced XHTML report under coverage/.
88
+
89
+ rcov can output information in several formats, and perform different kinds
90
+ of analyses in addition to plain code coverage. See rcov --help for a
91
+ description of the available options.
92
+
93
+ License
94
+ -------
95
+
96
+ rcov is licensed under the same terms as Ruby. See LICENSE.
97
+ rcov includes a copy of the xx library, which carries the following
98
+ copyright notice:
99
+
100
+ ePark Labs Public License version 1
101
+ Copyright (c) 2005, ePark Labs, Inc. and contributors
102
+ All rights reserved.
103
+
104
+ Redistribution and use in source and binary forms, with or without modification,
105
+ are permitted provided that the following conditions are met:
106
+
107
+ 1. Redistributions of source code must retain the above copyright notice, this
108
+ list of conditions and the following disclaimer.
109
+ 2. Redistributions in binary form must reproduce the above copyright notice,
110
+ this list of conditions and the following disclaimer in the documentation
111
+ and/or other materials provided with the distribution.
112
+ 3. Neither the name of ePark Labs nor the names of its contributors may be
113
+ used to endorse or promote products derived from this software without
114
+ specific prior written permission.
115
+
116
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
117
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
118
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
119
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
120
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
121
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
122
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
123
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
124
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
125
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
126
+
127
+
128
+ Mauricio Fernandez <mfp@acm.org>