brew/Library/Homebrew/test/.simplecov
Xu Cheng 28776ee1c3 tests: add coveralls support
Closes Homebrew/homebrew#47185.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-21 12:14:49 +08:00

31 lines
724 B
Ruby

# vim: filetype=ruby
SimpleCov.start do
tests_path = File.dirname(__FILE__)
minimum_coverage 50
coverage_dir File.expand_path("#{tests_path}/coverage")
root File.expand_path("#{tests_path}/../../")
add_filter "vendor/bundle/"
add_filter "Formula/"
add_filter "Homebrew/compat/"
add_filter "Homebrew/test/"
add_filter "Homebrew/vendor/"
end
if name = ENV["HOMEBREW_INTEGRATION_TEST"]
SimpleCov.command_name "brew #{name}"
SimpleCov.at_exit do
exit_code = $!.nil? ? 0 : $!.status
$stdout.reopen("/dev/null")
SimpleCov.result.format!
exit! exit_code
end
end
if RUBY_VERSION.split(".").first.to_i >= 2 && !ENV["HOMEBREW_INTEGRATION_TEST"]
require "coveralls"
Coveralls.wear!
end