katsuya-rcov 0.9.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/BLURB +111 -0
- data/LICENSE +53 -0
- data/Rakefile +103 -0
- data/THANKS +110 -0
- data/bin/rcov +514 -0
- data/doc/readme_for_api.markdown +22 -0
- data/doc/readme_for_emacs.markdown +52 -0
- data/doc/readme_for_rake.markdown +51 -0
- data/doc/readme_for_vim.markdown +34 -0
- data/editor-extensions/rcov.el +131 -0
- data/editor-extensions/rcov.vim +38 -0
- data/ext/rcovrt/1.8/callsite.c +216 -0
- data/ext/rcovrt/1.8/rcovrt.c +294 -0
- data/ext/rcovrt/1.9/callsite.c +234 -0
- data/ext/rcovrt/1.9/rcovrt.c +264 -0
- data/ext/rcovrt/extconf.rb +21 -0
- data/lib/rcov.rb +33 -0
- data/lib/rcov/call_site_analyzer.rb +225 -0
- data/lib/rcov/code_coverage_analyzer.rb +271 -0
- data/lib/rcov/coverage_info.rb +36 -0
- data/lib/rcov/differential_analyzer.rb +116 -0
- data/lib/rcov/file_statistics.rb +355 -0
- data/lib/rcov/formatters.rb +13 -0
- data/lib/rcov/formatters/base_formatter.rb +174 -0
- data/lib/rcov/formatters/failure_report.rb +15 -0
- data/lib/rcov/formatters/full_text_report.rb +48 -0
- data/lib/rcov/formatters/html_coverage.rb +274 -0
- data/lib/rcov/formatters/html_erb_template.rb +62 -0
- data/lib/rcov/formatters/text_coverage_diff.rb +193 -0
- data/lib/rcov/formatters/text_report.rb +32 -0
- data/lib/rcov/formatters/text_summary.rb +11 -0
- data/lib/rcov/lowlevel.rb +146 -0
- data/lib/rcov/rcovtask.rb +155 -0
- data/lib/rcov/templates/detail.html.erb +64 -0
- data/lib/rcov/templates/index.html.erb +93 -0
- data/lib/rcov/templates/jquery-1.3.2.min.js +19 -0
- data/lib/rcov/templates/jquery.tablesorter.min.js +15 -0
- data/lib/rcov/templates/print.css +12 -0
- data/lib/rcov/templates/rcov.js +42 -0
- data/lib/rcov/templates/screen.css +270 -0
- data/lib/rcov/version.rb +10 -0
- data/setup.rb +1588 -0
- data/test/assets/sample_01.rb +7 -0
- data/test/assets/sample_02.rb +5 -0
- data/test/assets/sample_03.rb +20 -0
- data/test/assets/sample_04.rb +10 -0
- data/test/assets/sample_05-new.rb +17 -0
- data/test/assets/sample_05-old.rb +13 -0
- data/test/assets/sample_05.rb +17 -0
- data/test/assets/sample_06.rb +8 -0
- data/test/call_site_analyzer_test.rb +171 -0
- data/test/code_coverage_analyzer_test.rb +219 -0
- data/test/expected_coverage/diff-gcc-all.out +7 -0
- data/test/expected_coverage/diff-gcc-diff.out +11 -0
- data/test/expected_coverage/diff-gcc-original.out +5 -0
- data/test/expected_coverage/diff-no-color.out +12 -0
- data/test/expected_coverage/diff.out +12 -0
- data/test/expected_coverage/gcc-text.out +10 -0
- data/test/expected_coverage/sample_03_rb.html +651 -0
- data/test/expected_coverage/sample_03_rb.rb +28 -0
- data/test/expected_coverage/sample_04_rb.html +641 -0
- data/test/file_statistics_test.rb +471 -0
- data/test/functional_test.rb +91 -0
- data/test/test_helper.rb +4 -0
- data/test/turn_off_rcovrt.rb +4 -0
- metadata +126 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
|
2
|
+
|
|
3
|
+
=begin
|
|
4
|
+
Updating functional testdata automatically is DANGEROUS, so I do manually.
|
|
5
|
+
|
|
6
|
+
== update functional test
|
|
7
|
+
cd ~/src/rcov/test
|
|
8
|
+
rcov="ruby ../bin/rcov -I../lib:../ext/rcovrt -o expected_coverage"
|
|
9
|
+
|
|
10
|
+
$rcov -a sample_04.rb
|
|
11
|
+
$rcov sample_04.rb
|
|
12
|
+
$rcov --gcc --include-file=sample --exclude=rcov sample_04.rb > expected_coverage/gcc-text.out
|
|
13
|
+
|
|
14
|
+
cp sample_05-old.rb sample_05.rb
|
|
15
|
+
$rcov --no-html --gcc --include-file=sample --exclude=rcov --save=coverage.info sample_05.rb > expected_coverage/diff-gcc-original.out
|
|
16
|
+
cp sample_05-new.rb sample_05.rb
|
|
17
|
+
$rcov --no-html --gcc -D --include-file=sample --exclude=rcov sample_05.rb > expected_coverage/diff-gcc-diff.out
|
|
18
|
+
$rcov --no-html -D --include-file=sample --exclude=rcov sample_05.rb > expected_coverage/diff.out
|
|
19
|
+
$rcov --no-html --no-color -D --include-file=sample --exclude=rcov sample_05.rb > expected_coverage/diff-no-color.out
|
|
20
|
+
$rcov --no-html --gcc --include-file=sample --exclude=rcov sample_05.rb > expected_coverage/diff-gcc-all.out
|
|
21
|
+
|
|
22
|
+
=end
|
|
23
|
+
|
|
24
|
+
class TestFunctional < Test::Unit::TestCase
|
|
25
|
+
@@dir = Pathname(__FILE__).expand_path.dirname
|
|
26
|
+
|
|
27
|
+
def strip_variable_sections(str)
|
|
28
|
+
str.sub(/Generated on.+$/, '').sub(/Generated using the.+$/, '').squeeze("\n")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def cmp(file)
|
|
32
|
+
content = lambda{|dir| strip_variable_sections(File.read(@@dir+dir+file))}
|
|
33
|
+
|
|
34
|
+
assert_equal(content["expected_coverage"], content["actual_coverage"])
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def with_testdir(&block)
|
|
38
|
+
Dir.chdir(@@dir, &block)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def run_rcov(opts, script="assets/sample_04.rb", opts_tail="")
|
|
42
|
+
rcov = @@dir+"../bin/rcov"
|
|
43
|
+
ruby_opts = "-I../lib:../ext/rcovrt"
|
|
44
|
+
ruby = "ruby"
|
|
45
|
+
ruby = "jruby" if RUBY_PLATFORM =~ /java/
|
|
46
|
+
with_testdir do
|
|
47
|
+
`cd #{@@dir}; #{ruby} #{ruby_opts} #{rcov} #{opts} -o actual_coverage #{script} #{opts_tail}`
|
|
48
|
+
yield if block_given?
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def test_annotation
|
|
53
|
+
run_rcov("-a") do
|
|
54
|
+
cmp "../assets/sample_04.rb"
|
|
55
|
+
cmp "../assets/sample_03.rb"
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
@@selection = "--include-file=sample --exclude=rcov"
|
|
60
|
+
def test_text_gcc
|
|
61
|
+
run_rcov("--gcc #{@@selection}", "assets/sample_04.rb", "> actual_coverage/gcc-text.out") do
|
|
62
|
+
cmp "gcc-text.out"
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def test_diff
|
|
67
|
+
with_testdir { FileUtils.cp "assets/sample_05-old.rb", "assets/sample_05.rb" }
|
|
68
|
+
|
|
69
|
+
run_rcov("--no-html --gcc #{@@selection} --save=coverage.info", "assets/sample_05.rb", "> actual_coverage/diff-gcc-original.out") do
|
|
70
|
+
cmp "diff-gcc-original.out"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
with_testdir { FileUtils.cp "assets/sample_05-new.rb", "assets/sample_05.rb" }
|
|
74
|
+
run_rcov("--no-html -D --gcc #{@@selection}", "assets/sample_05.rb", "> actual_coverage/diff-gcc-diff.out") do
|
|
75
|
+
cmp "diff-gcc-diff.out"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
run_rcov("--no-html -D #{@@selection}", "assets/sample_05.rb", "> actual_coverage/diff.out") do
|
|
79
|
+
cmp "diff.out"
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
run_rcov("--no-html --no-color -D #{@@selection}", "assets/sample_05.rb", "> actual_coverage/diff-no-color.out") do
|
|
83
|
+
cmp "diff-no-color.out"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
run_rcov("--no-html --gcc #{@@selection}", "assets/sample_05.rb", "> actual_coverage/diff-gcc-all.out") do
|
|
87
|
+
cmp "diff-gcc-all.out"
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: katsuya-rcov
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.9.7.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Relevance
|
|
8
|
+
- Chad Humphries (spicycode)
|
|
9
|
+
- Aaron Bedra (abedra)
|
|
10
|
+
- Jay McGaffigan
|
|
11
|
+
- Mauricio Fernandez
|
|
12
|
+
autorequire:
|
|
13
|
+
bindir: bin
|
|
14
|
+
cert_chain:
|
|
15
|
+
date: 2009-12-29 00:00:00 +09:00
|
|
16
|
+
default_executable: rcov
|
|
17
|
+
dependencies: []
|
|
18
|
+
|
|
19
|
+
description: rcov is a code coverage tool for Ruby. It is commonly used for viewing overall test unit coverage of target code. It features fast execution (20-300 times faster than previous tools), multiple analysis modes, XHTML and several kinds of text reports, easy automation with Rake via a RcovTask, fairly accurate coverage information through code linkage inference using simple heuristics, colorblind-friendliness...
|
|
20
|
+
email: opensource@thinkrelevance.com
|
|
21
|
+
executables:
|
|
22
|
+
- rcov
|
|
23
|
+
extensions:
|
|
24
|
+
- ext/rcovrt/extconf.rb
|
|
25
|
+
extra_rdoc_files: []
|
|
26
|
+
|
|
27
|
+
files:
|
|
28
|
+
- bin/rcov
|
|
29
|
+
- lib/rcov.rb
|
|
30
|
+
- lib/rcov/lowlevel.rb
|
|
31
|
+
- lib/rcov/version.rb
|
|
32
|
+
- lib/rcov/rcovtask.rb
|
|
33
|
+
- lib/rcov/formatters.rb
|
|
34
|
+
- lib/rcov/call_site_analyzer.rb
|
|
35
|
+
- lib/rcov/code_coverage_analyzer.rb
|
|
36
|
+
- lib/rcov/coverage_info.rb
|
|
37
|
+
- lib/rcov/differential_analyzer.rb
|
|
38
|
+
- lib/rcov/file_statistics.rb
|
|
39
|
+
- lib/rcov/formatters/base_formatter.rb
|
|
40
|
+
- lib/rcov/formatters/full_text_report.rb
|
|
41
|
+
- lib/rcov/formatters/html_erb_template.rb
|
|
42
|
+
- lib/rcov/formatters/html_coverage.rb
|
|
43
|
+
- lib/rcov/formatters/text_coverage_diff.rb
|
|
44
|
+
- lib/rcov/formatters/text_report.rb
|
|
45
|
+
- lib/rcov/formatters/text_summary.rb
|
|
46
|
+
- lib/rcov/formatters/failure_report.rb
|
|
47
|
+
- lib/rcov/templates/index.html.erb
|
|
48
|
+
- lib/rcov/templates/detail.html.erb
|
|
49
|
+
- lib/rcov/templates/screen.css
|
|
50
|
+
- lib/rcov/templates/print.css
|
|
51
|
+
- lib/rcov/templates/rcov.js
|
|
52
|
+
- lib/rcov/templates/jquery-1.3.2.min.js
|
|
53
|
+
- lib/rcov/templates/jquery.tablesorter.min.js
|
|
54
|
+
- ext/rcovrt/extconf.rb
|
|
55
|
+
- ext/rcovrt/1.8/rcovrt.c
|
|
56
|
+
- ext/rcovrt/1.9/rcovrt.c
|
|
57
|
+
- ext/rcovrt/1.8/callsite.c
|
|
58
|
+
- ext/rcovrt/1.9/callsite.c
|
|
59
|
+
- LICENSE
|
|
60
|
+
- Rakefile
|
|
61
|
+
- doc/readme_for_rake.markdown
|
|
62
|
+
- doc/readme_for_vim.markdown
|
|
63
|
+
- doc/readme_for_emacs.markdown
|
|
64
|
+
- doc/readme_for_api.markdown
|
|
65
|
+
- THANKS
|
|
66
|
+
- test/functional_test.rb
|
|
67
|
+
- test/file_statistics_test.rb
|
|
68
|
+
- test/assets/sample_03.rb
|
|
69
|
+
- test/assets/sample_05-new.rb
|
|
70
|
+
- test/code_coverage_analyzer_test.rb
|
|
71
|
+
- test/assets/sample_04.rb
|
|
72
|
+
- test/assets/sample_02.rb
|
|
73
|
+
- test/assets/sample_05-old.rb
|
|
74
|
+
- test/assets/sample_01.rb
|
|
75
|
+
- test/turn_off_rcovrt.rb
|
|
76
|
+
- test/call_site_analyzer_test.rb
|
|
77
|
+
- test/assets/sample_05.rb
|
|
78
|
+
- test/assets/sample_06.rb
|
|
79
|
+
- editor-extensions/rcov.vim
|
|
80
|
+
- test/test_helper.rb
|
|
81
|
+
- test/expected_coverage/diff-gcc-all.out
|
|
82
|
+
- test/expected_coverage/diff-gcc-diff.out
|
|
83
|
+
- test/expected_coverage/diff-gcc-original.out
|
|
84
|
+
- test/expected_coverage/diff-no-color.out
|
|
85
|
+
- test/expected_coverage/diff.out
|
|
86
|
+
- test/expected_coverage/gcc-text.out
|
|
87
|
+
- test/expected_coverage/sample_03_rb.html
|
|
88
|
+
- test/expected_coverage/sample_03_rb.rb
|
|
89
|
+
- test/expected_coverage/sample_04_rb.html
|
|
90
|
+
- editor-extensions/rcov.el
|
|
91
|
+
- setup.rb
|
|
92
|
+
- BLURB
|
|
93
|
+
has_rdoc: true
|
|
94
|
+
homepage: http://github.com/katsuya/rcov
|
|
95
|
+
licenses: []
|
|
96
|
+
|
|
97
|
+
post_install_message:
|
|
98
|
+
rdoc_options:
|
|
99
|
+
- --title
|
|
100
|
+
- rcov code coverage tool
|
|
101
|
+
require_paths:
|
|
102
|
+
- lib
|
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
|
+
requirements:
|
|
105
|
+
- - ">"
|
|
106
|
+
- !ruby/object:Gem::Version
|
|
107
|
+
version: 0.0.0
|
|
108
|
+
version:
|
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
|
+
requirements:
|
|
111
|
+
- - ">="
|
|
112
|
+
- !ruby/object:Gem::Version
|
|
113
|
+
version: "0"
|
|
114
|
+
version:
|
|
115
|
+
requirements: []
|
|
116
|
+
|
|
117
|
+
rubyforge_project:
|
|
118
|
+
rubygems_version: 1.3.5
|
|
119
|
+
signing_key:
|
|
120
|
+
specification_version: 1
|
|
121
|
+
summary: Code coverage analysis tool for Ruby
|
|
122
|
+
test_files:
|
|
123
|
+
- test/functional_test.rb
|
|
124
|
+
- test/file_statistics_test.rb
|
|
125
|
+
- test/code_coverage_analyzer_test.rb
|
|
126
|
+
- test/call_site_analyzer_test.rb
|