valo-rcov 0.8.3.4

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.
Files changed (45) hide show
  1. data/BLURB +111 -0
  2. data/LICENSE +53 -0
  3. data/Rakefile +88 -0
  4. data/THANKS +96 -0
  5. data/bin/rcov +500 -0
  6. data/doc/readme_for_api +41 -0
  7. data/doc/readme_for_emacs +64 -0
  8. data/doc/readme_for_rake +62 -0
  9. data/doc/readme_for_vim +47 -0
  10. data/editor-extensions/rcov.el +131 -0
  11. data/editor-extensions/rcov.vim +38 -0
  12. data/ext/rcovrt/1.8/callsite.c +216 -0
  13. data/ext/rcovrt/1.8/rcovrt.c +287 -0
  14. data/ext/rcovrt/1.9/callsite.c +234 -0
  15. data/ext/rcovrt/1.9/rcovrt.c +264 -0
  16. data/ext/rcovrt/extconf.rb +21 -0
  17. data/lib/rcov.rb +1009 -0
  18. data/lib/rcov/formatters.rb +15 -0
  19. data/lib/rcov/formatters/base_formatter.rb +168 -0
  20. data/lib/rcov/formatters/full_text_report.rb +55 -0
  21. data/lib/rcov/formatters/html_coverage.rb +255 -0
  22. data/lib/rcov/formatters/html_erb_template.rb +128 -0
  23. data/lib/rcov/formatters/text_coverage_diff.rb +199 -0
  24. data/lib/rcov/formatters/text_report.rb +36 -0
  25. data/lib/rcov/formatters/text_summary.rb +15 -0
  26. data/lib/rcov/lowlevel.rb +145 -0
  27. data/lib/rcov/rcovtask.rb +156 -0
  28. data/lib/rcov/templates/detail.html.erb +78 -0
  29. data/lib/rcov/templates/index.html.erb +76 -0
  30. data/lib/rcov/templates/screen.css +165 -0
  31. data/lib/rcov/version.rb +10 -0
  32. data/setup.rb +1588 -0
  33. data/test/assets/sample_01.rb +7 -0
  34. data/test/assets/sample_02.rb +5 -0
  35. data/test/assets/sample_03.rb +20 -0
  36. data/test/assets/sample_04.rb +10 -0
  37. data/test/assets/sample_05-new.rb +17 -0
  38. data/test/assets/sample_05-old.rb +13 -0
  39. data/test/assets/sample_05.rb +17 -0
  40. data/test/call_site_analyzer_test.rb +171 -0
  41. data/test/code_coverage_analyzer_test.rb +184 -0
  42. data/test/file_statistics_test.rb +471 -0
  43. data/test/functional_test.rb +89 -0
  44. data/test/turn_off_rcovrt.rb +4 -0
  45. metadata +107 -0
@@ -0,0 +1,89 @@
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
+ with_testdir do
45
+ `cd #{@@dir}; ruby #{ruby_opts} #{rcov} #{opts} -o actual_coverage #{script} #{opts_tail}`
46
+ yield if block_given?
47
+ end
48
+ end
49
+
50
+ def test_annotation
51
+ run_rcov("-a") do
52
+ cmp "../assets/sample_04.rb"
53
+ cmp "../assets/sample_03.rb"
54
+ end
55
+ end
56
+
57
+ @@selection = "--include-file=sample --exclude=rcov"
58
+ def test_text_gcc
59
+ run_rcov("--gcc #{@@selection}", "assets/sample_04.rb", "> actual_coverage/gcc-text.out") do
60
+ cmp "gcc-text.out"
61
+ end
62
+ end
63
+
64
+ def test_diff
65
+ with_testdir { FileUtils.cp "assets/sample_05-old.rb", "assets/sample_05.rb" }
66
+
67
+ run_rcov("--no-html --gcc #{@@selection} --save=coverage.info", "assets/sample_05.rb", "> actual_coverage/diff-gcc-original.out") do
68
+ cmp "diff-gcc-original.out"
69
+ end
70
+
71
+ with_testdir { FileUtils.cp "assets/sample_05-new.rb", "assets/sample_05.rb" }
72
+ run_rcov("--no-html -D --gcc #{@@selection}", "assets/sample_05.rb", "> actual_coverage/diff-gcc-diff.out") do
73
+ cmp "diff-gcc-diff.out"
74
+ end
75
+
76
+ run_rcov("--no-html -D #{@@selection}", "assets/sample_05.rb", "> actual_coverage/diff.out") do
77
+ cmp "diff.out"
78
+ end
79
+
80
+ run_rcov("--no-html --no-color -D #{@@selection}", "assets/sample_05.rb", "> actual_coverage/diff-no-color.out") do
81
+ cmp "diff-no-color.out"
82
+ end
83
+
84
+ run_rcov("--no-html --gcc #{@@selection}", "assets/sample_05.rb", "> actual_coverage/diff-gcc-all.out") do
85
+ cmp "diff-gcc-all.out"
86
+ end
87
+ end
88
+
89
+ end
@@ -0,0 +1,4 @@
1
+ # When loaded, this file forces rcov to run in pure-Ruby mode even if
2
+ # rcovrt.so exists and can be loaded.
3
+
4
+ $rcov_do_not_use_rcovrt = true
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: valo-rcov
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.3.4
5
+ platform: ruby
6
+ authors:
7
+ - Relevance
8
+ - Chad Humphries (spicycode)
9
+ - Aaron Bedra (abedra)
10
+ - Mauricio Fernandez
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain:
14
+ date: 2009-05-12 00:00:00 -07:00
15
+ default_executable: rcov
16
+ dependencies: []
17
+
18
+ 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...
19
+ email: opensource@thinkrelevance.com
20
+ executables:
21
+ - rcov
22
+ extensions:
23
+ - ext/rcovrt/extconf.rb
24
+ extra_rdoc_files:
25
+ - doc/readme_for_api
26
+ - doc/readme_for_rake
27
+ - doc/readme_for_vim
28
+ - doc/readme_for_emacs
29
+ files:
30
+ - bin/rcov
31
+ - lib/rcov.rb
32
+ - lib/rcov/lowlevel.rb
33
+ - lib/rcov/version.rb
34
+ - lib/rcov/rcovtask.rb
35
+ - lib/rcov/formatters.rb
36
+ - lib/rcov/formatters/base_formatter.rb
37
+ - lib/rcov/formatters/full_text_report.rb
38
+ - lib/rcov/formatters/html_erb_template.rb
39
+ - lib/rcov/formatters/html_coverage.rb
40
+ - lib/rcov/formatters/text_coverage_diff.rb
41
+ - lib/rcov/formatters/text_report.rb
42
+ - lib/rcov/formatters/text_summary.rb
43
+ - lib/rcov/templates/index.html.erb
44
+ - lib/rcov/templates/detail.html.erb
45
+ - lib/rcov/templates/screen.css
46
+ - ext/rcovrt/extconf.rb
47
+ - ext/rcovrt/1.8/rcovrt.c
48
+ - ext/rcovrt/1.9/rcovrt.c
49
+ - ext/rcovrt/1.8/callsite.c
50
+ - ext/rcovrt/1.9/callsite.c
51
+ - LICENSE
52
+ - Rakefile
53
+ - doc/readme_for_rake
54
+ - doc/readme_for_vim
55
+ - doc/readme_for_emacs
56
+ - doc/readme_for_api
57
+ - THANKS
58
+ - test/functional_test.rb
59
+ - test/file_statistics_test.rb
60
+ - test/assets/sample_03.rb
61
+ - test/assets/sample_05-new.rb
62
+ - test/code_coverage_analyzer_test.rb
63
+ - test/assets/sample_04.rb
64
+ - test/assets/sample_02.rb
65
+ - test/assets/sample_05-old.rb
66
+ - test/assets/sample_01.rb
67
+ - test/turn_off_rcovrt.rb
68
+ - test/call_site_analyzer_test.rb
69
+ - test/assets/sample_05.rb
70
+ - editor-extensions/rcov.vim
71
+ - editor-extensions/rcov.el
72
+ - setup.rb
73
+ - BLURB
74
+ has_rdoc: true
75
+ homepage: http://github.com/relevance/rcov
76
+ post_install_message:
77
+ rdoc_options:
78
+ - --main
79
+ - readme_for_api
80
+ - --title
81
+ - rcov code coverage tool
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">"
87
+ - !ruby/object:Gem::Version
88
+ version: 0.0.0
89
+ version:
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: "0"
95
+ version:
96
+ requirements: []
97
+
98
+ rubyforge_project:
99
+ rubygems_version: 1.2.0
100
+ signing_key:
101
+ specification_version: 1
102
+ summary: Code coverage analysis tool for Ruby
103
+ test_files:
104
+ - test/functional_test.rb
105
+ - test/file_statistics_test.rb
106
+ - test/code_coverage_analyzer_test.rb
107
+ - test/call_site_analyzer_test.rb