mergulhao / rcov forked from spicycode/rcov

Rcov with segfault bug patched

This URL has Read+Write access

rcov / Rantfile
cc90aba4 » mfp 2006-05-28 Rantfile: "ported" the Rake... 1 # This Rantfile serves as an example of how to use the Rcov generator.
2 # Take a look at the RDoc documentation (or README.rant) for further
3 # information.
4
5 $:.unshift "lib" if File.directory? "lib"
6
7 import %w(rubytest rubydoc autoclean)
8 require 'rcov/rant'
9
10 task :default => :test
11
12 # Use the specified rcov executable instead of the one in $PATH
13 # (this way we get a sort of informal functional test).
14 # This could also be specified from the command like, e.g.
15 # rake rcov RCOVPATH=/path/to/myrcov
16 ENV["RCOVPATH"] = "bin/rcov"
17
18 desc "Create a cross-referenced code coverage report."
19 gen Rcov do |g|
20 g.libs << "ext/rcovrt"
21 g.test_files = sys['test/test*.rb']
22 g.rcov_opts << "--callsites" # comment to disable cross-references
23 end
24
25 desc "Analyze code coverage for the FileStatistics class."
26 gen Rcov, :rcov_sourcefile do |g|
27 g.libs << "ext/rcovrt"
28 g.test_files = sys['test/test_FileStatistics.rb']
29 g.rcov_opts << "--test-unit-only"
30 g.output_dir = "coverage.sourcefile"
31 end
32
33 desc "Analyze code coverage for CodeCoverageAnalyzer."
34 gen Rcov, :rcov_ccanalyzer do |g|
35 g.libs << "ext/rcovrt"
36 g.test_files = sys['test/test_CodeCoverageAnalyzer.rb']
37 g.rcov_opts << "--test-unit-only"
38 g.output_dir = "coverage.ccanalyzer"
39 end
40
41 desc "Run the unit tests, both rcovrt and pure-Ruby modes"
42 task :test => [:test_rcovrt, :test_pure_ruby]
43
44 desc "Run the unit tests with rcovrt."
45 gen RubyTest, :test_rcovrt => %w[ext/rcovrt/rcovrt.so] do |g|
46 g.libs << "ext/rcovrt"
47 g.test_files = sys['test/test*.rb']
48 g.verbose = true
49 end
50
51 file "ext/rcovrt/rcovrt.so" => "ext/rcovrt/rcov.c" do
52 sys "ruby setup.rb config"
53 sys "ruby setup.rb setup"
54 end
55
56 desc "Run the unit tests in pure-Ruby mode."
57 gen RubyTest, :test_pure_ruby do |g|
58 g.libs << "ext/rcovrt"
59 g.test_files = sys['test/turn_off_rcovrt.rb', 'test/test*.rb']
60 g.verbose = true
61 end
62
63 desc "Generate documentation."
64 gen RubyDoc, :rdoc do |g|
65 g.verbose = true
66 g.dir = "doc"
e28bed06 » mfp 2006-06-11 README.vim, Rakefile, Rantf... 67 g.files = sys["README.API", "README.rake", "README.rant", "README.vim",
68 "lib/**/*.rb"]
cc90aba4 » mfp 2006-05-28 Rantfile: "ported" the Rake... 69 g.opts = %w(--line-numbers --inline-source --title rcov --main README.API)
70 end
71
72 desc "Remove autogenerated files."
73 gen AutoClean, :clean
74 var[:clean].include %w(InstalledFiles .config coverage coverage.* )
75
76 # vim: set sw=2 ft=ruby: