Permalink
Browse files

Merge branch 'master' of github.com:relevance/rcov

  • Loading branch information...
2 parents dea676c + 4f01265 commit e7c1821b50bef0f933ef857278bf82e9c24638e4 @abedra abedra committed Jan 21, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 bin/rcov
View
20 bin/rcov
@@ -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
@@ -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
@@ -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,

0 comments on commit e7c1821

Please sign in to comment.