hooligan495-rcov 0.8.1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,94 @@
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.+$/, '')
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}",
60
+ "assets/sample_04.rb",
61
+ "> 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
+ run_rcov("--no-html --gcc #{@@selection} --save=coverage.info", "assets/sample_05.rb",
69
+ "> 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",
75
+ "> actual_coverage/diff-gcc-diff.out") do
76
+ cmp "diff-gcc-diff.out"
77
+ end
78
+
79
+ run_rcov("--no-html -D #{@@selection}", "assets/sample_05.rb",
80
+ "> actual_coverage/diff.out") do
81
+ cmp "diff.out"
82
+ end
83
+
84
+ run_rcov("--no-html --no-color -D #{@@selection}", "assets/sample_05.rb",
85
+ "> actual_coverage/diff-no-color.out") do
86
+ cmp "diff-no-color.out"
87
+ end
88
+
89
+ run_rcov("--no-html --gcc #{@@selection}", "assets/sample_05.rb",
90
+ "> actual_coverage/diff-gcc-all.out") do
91
+ cmp "diff-gcc-all.out"
92
+ end
93
+ end
94
+ 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,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hooligan495-rcov
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.8.1.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Mauricio Fernandez
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ date: 2008-08-29 00:00:00 -07:00
12
+ default_executable: rcov
13
+ dependencies: []
14
+
15
+ 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...
16
+ email: mfp@acm.org
17
+ executables:
18
+ - rcov
19
+ extensions:
20
+ - ext/rcovrt/extconf.rb
21
+ extra_rdoc_files:
22
+ - README.API
23
+ - README.rake
24
+ - README.rant
25
+ - README.vim
26
+ files:
27
+ - bin/rcov
28
+ - lib/rcov.rb
29
+ - lib/rcov/lowlevel.rb
30
+ - lib/rcov/xx.rb
31
+ - lib/rcov/version.rb
32
+ - lib/rcov/rant.rb
33
+ - lib/rcov/report.rb
34
+ - lib/rcov/rcovtask.rb
35
+ - ext/rcovrt/extconf.rb
36
+ - ext/rcovrt/rcovrt.c
37
+ - ext/rcovrt/callsite.c
38
+ - LEGAL
39
+ - LICENSE
40
+ - Rakefile
41
+ - Rantfile
42
+ - README.rake
43
+ - README.rant
44
+ - README.emacs
45
+ - README.en
46
+ - README.vim
47
+ - README.API
48
+ - THANKS
49
+ - test/functional_test.rb
50
+ - test/file_statistics_test.rb
51
+ - test/assets/sample_03.rb
52
+ - test/assets/sample_05-new.rb
53
+ - test/code_coverage_analyzer_test.rb
54
+ - test/assets/sample_04.rb
55
+ - test/assets/sample_02.rb
56
+ - test/assets/sample_05-old.rb
57
+ - test/assets/sample_01.rb
58
+ - test/turn_off_rcovrt.rb
59
+ - test/call_site_analyzer_test.rb
60
+ - test/assets/sample_05.rb
61
+ - rcov.vim
62
+ - rcov.el
63
+ - setup.rb
64
+ - BLURB
65
+ - CHANGES
66
+ has_rdoc: true
67
+ homepage: http://eigenclass.org/hiki.rb?rcov
68
+ post_install_message:
69
+ rdoc_options:
70
+ - --main
71
+ - README.API
72
+ - --title
73
+ - rcov code coverage tool
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">"
79
+ - !ruby/object:Gem::Version
80
+ version: 0.0.0
81
+ version:
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: "0"
87
+ version:
88
+ requirements: []
89
+
90
+ rubyforge_project:
91
+ rubygems_version: 1.2.0
92
+ signing_key:
93
+ specification_version: 1
94
+ summary: Code coverage analysis tool for Ruby
95
+ test_files:
96
+ - test/functional_test.rb
97
+ - test/file_statistics_test.rb
98
+ - test/code_coverage_analyzer_test.rb
99
+ - test/call_site_analyzer_test.rb