Skip to content

Commit

Permalink
Merge branch 'master' of github.com:relevance/rcov
Browse files Browse the repository at this point in the history
  • Loading branch information
abedra committed Jan 21, 2012
2 parents dea676c + 4f01265 commit e7c1821
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bin/rcov
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ options.profiling = false
options.destdir = nil
options.loadpaths = []
options.textmode = false
options.custom_formatters = []
options.skip = Rcov::BaseFormatter::DEFAULT_OPTS[:ignore]
options.include = []
options.html = true
Expand Down Expand Up @@ -184,6 +185,21 @@ EOF
opts.on("--text-coverage", "Dump coverage info to stdout, using", "ANSI color sequences unless -n.") do
options.textmode = :coverage
end

opts.on("--require LIB", "Require an additional lib before running") do |file|
require file
end

opts.on("--custom-formatter EXPR", "Generate additional output using a",
"custom formatter class. The expression",
"is evaluated as Ruby code and should",
"return a Class object") do |class_expr|
formatter = instance_eval class_expr
unless formatter.is_a? Class
raise "--custom-formatter expression must return a Class object. Got a #{formatter.class.name}"
end
options.custom_formatters << formatter
end

opts.on("--gcc", "Dump uncovered line in GCC error format.") do
options.gcc_output = true
Expand Down Expand Up @@ -401,6 +417,10 @@ if options.html
end
end

options.custom_formatters.each do |formatter|
formatters << make_formatter[formatter]
end

textual_formatters = { :counts => Rcov::FullTextReport, :coverage => Rcov::FullTextReport,
:gcc => Rcov::FullTextReport, :annotate => Rcov::RubyAnnotation,
:summary => Rcov::TextSummary, :report => Rcov::TextReport,
Expand Down

0 comments on commit e7c1821

Please sign in to comment.