bartes-rcov_stats 1.1.2 → 1.1.3
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/README +11 -0
- data/lib/rcov_stats.rb +4 -8
- metadata +1 -1
data/README
CHANGED
@@ -28,4 +28,15 @@ You can specify there :
|
|
28
28
|
- action which will be used before running test suite (before_rcov -> by default db:test:prepare)
|
29
29
|
|
30
30
|
|
31
|
+
You can run:
|
32
|
+
- rake rcov:stats (includes rcov:units and rcov:functionals)
|
33
|
+
- rake rcov:units
|
34
|
+
- rake rcov:functionals
|
35
|
+
- rake rcov:general (includes rcov:units and rcov:functionals, but counts one general coverage and puts all results in one output directory)
|
36
|
+
|
37
|
+
|
38
|
+
You can grab rcov gem with :
|
39
|
+
gem install relevance-rcov
|
40
|
+
|
41
|
+
|
31
42
|
Copyright (c) 2009 [bartes], released under the MIT license
|
data/lib/rcov_stats.rb
CHANGED
@@ -44,10 +44,6 @@ module RcovStats
|
|
44
44
|
get_array_data "functionals_files_to_test"
|
45
45
|
end
|
46
46
|
|
47
|
-
def excluded_paths
|
48
|
-
%w(spec gems plugins)
|
49
|
-
end
|
50
|
-
|
51
47
|
def igonored_paths
|
52
48
|
%w(. .. .svn)
|
53
49
|
end
|
@@ -119,8 +115,7 @@ module RcovStats
|
|
119
115
|
def invoke_rcov_task(options)
|
120
116
|
require 'rake/win32'
|
121
117
|
files_to_cover = parse_file_to_cover(options[:files_to_cover].uniq).map{|f| "(#{f})".gsub("/","\/")}.join("|")
|
122
|
-
rcov_settings = "--sort coverage --text-summary
|
123
|
-
rcov_settings +="--exclude \"#{excluded_paths.map{|p| "#{p}/*"}.join(",")}\" "
|
118
|
+
rcov_settings = "--sort coverage --text-summary -x \"^(?!(#{files_to_cover}))\" "
|
124
119
|
rcov_settings +="--output=#{File.join(root,"coverage",options[:output])} " if options[:output]
|
125
120
|
rcov_tests = parse_file_to_test(options[:files_to_test].uniq)
|
126
121
|
return false if rcov_tests.empty?
|
@@ -134,12 +129,13 @@ module RcovStats
|
|
134
129
|
rcov_tests = parse_file_to_test(options[:files_to_test].uniq)
|
135
130
|
return false if rcov_tests.empty?
|
136
131
|
Spec::Rake::SpecTask.new(options[:name]) do |t|
|
137
|
-
|
132
|
+
spec_opts = File.join(root,'spec','spec.opts')
|
133
|
+
t.spec_opts = ['--options', "\"#{spec_opts}\""] if File.exists?(spec_opts)
|
138
134
|
t.spec_files = rcov_tests
|
139
135
|
t.rcov = true
|
140
136
|
t.rcov_dir = File.join(root,"coverage",options[:output]) if options[:output]
|
141
137
|
files_to_cover = parse_file_to_cover(options[:files_to_cover].uniq).map{|f| "(#{f})".gsub("/","\/")}.join("|")
|
142
|
-
t.rcov_opts = ["--
|
138
|
+
t.rcov_opts = ["--text-summary","--sort","coverage","-x","\"^(?!(#{files_to_cover}))\""]
|
143
139
|
end
|
144
140
|
end
|
145
141
|
|