--- bin/rcov 2007-10-04 23:20:48.000000000 -0500 +++ bin/rcov.new 2007-10-05 21:03:50.000000000 -0500 @@ -396,10 +396,15 @@ end end $rcov_code_coverage_analyzer ||= Rcov::CodeCoverageAnalyzer.new # must be registered before test/unit puts its own + + +# The exception to rethrow after reporting has been handled. +$__rcov_exit_exception = nil + END { $rcov_code_coverage_analyzer.remove_hook $rcov_callsite_analyzer.remove_hook if $rcov_callsite_analyzer rcov_save_aggregate_data(options.aggregate_file) if options.aggregate_file $rcov_code_coverage_analyzer.dump_coverage_info(formatters) @@ -466,10 +471,12 @@ $:.unshift File.join(File.dirname(__FILE__), "..", "lib") to test/test_*.rb, or running rcov via a Rakefile (read the RDoc documentation or README.rake in the source distribution). EOF end + + raise $__rcov_exit_exception if $__rcov_exit_exception } if options.test_unit_only require 'test/unit' module Test::Unit @@ -504,20 +511,23 @@ else $rcov_code_coverage_analyzer.install_hook end #{{{ Load scripts +begin pending_scripts = ARGV.clone ARGV.replace extra_args until pending_scripts.empty? prog = pending_scripts.shift if options.replace_prog_name $0 = File.basename(File.expand_path(prog)) end load prog end - +rescue Object => err + $__rcov_exit_exception = err +end # xx-0.1.0-1 follows __END__ # xx can be redistributed and used under the following conditions # (just keep the following copyright notice, list of conditions and disclaimer