2015-07-27 21:50:30 +01:00
|
|
|
# vim: filetype=ruby
|
|
|
|
|
|
|
|
|
|
SimpleCov.start do
|
|
|
|
|
tests_path = File.dirname(__FILE__)
|
|
|
|
|
|
2016-01-16 20:25:57 +01:00
|
|
|
minimum_coverage 60
|
2015-07-27 21:50:30 +01:00
|
|
|
coverage_dir File.expand_path("#{tests_path}/coverage")
|
2015-07-27 21:58:22 +01:00
|
|
|
root File.expand_path("#{tests_path}/../../")
|
2015-07-27 21:50:30 +01:00
|
|
|
|
2015-07-27 21:58:22 +01:00
|
|
|
add_filter "Formula/"
|
2015-07-27 21:50:30 +01:00
|
|
|
add_filter "Homebrew/compat/"
|
2015-07-27 21:58:22 +01:00
|
|
|
add_filter "Homebrew/test/"
|
|
|
|
|
add_filter "Homebrew/vendor/"
|
2015-07-27 21:50:30 +01:00
|
|
|
end
|
|
|
|
|
|
2016-01-20 06:16:10 +01:00
|
|
|
if ENV["HOMEBREW_INTEGRATION_TEST"]
|
|
|
|
|
SimpleCov.command_name ENV["HOMEBREW_INTEGRATION_TEST"]
|
2015-07-27 21:50:30 +01:00
|
|
|
SimpleCov.at_exit do
|
|
|
|
|
exit_code = $!.nil? ? 0 : $!.status
|
|
|
|
|
$stdout.reopen("/dev/null")
|
2016-01-20 11:33:33 +01:00
|
|
|
SimpleCov.result # Just save result, but don't write formatted output.
|
2015-07-27 21:50:30 +01:00
|
|
|
exit! exit_code
|
|
|
|
|
end
|
|
|
|
|
end
|
2015-12-21 11:18:11 +08:00
|
|
|
|
|
|
|
|
if RUBY_VERSION.split(".").first.to_i >= 2 && !ENV["HOMEBREW_INTEGRATION_TEST"]
|
|
|
|
|
require "coveralls"
|
|
|
|
|
Coveralls.wear!
|
|
|
|
|
end
|