brew/Library/Homebrew/test/.simplecov

32 lines
919 B
Plaintext
Raw Normal View History

# vim: filetype=ruby
SimpleCov.start do
tests_path = File.dirname(__FILE__)
2016-01-16 20:25:57 +01:00
minimum_coverage 60
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:58:22 +01:00
add_filter "Formula/"
add_filter "Homebrew/compat/"
2015-07-27 21:58:22 +01:00
add_filter "Homebrew/test/"
add_filter "Homebrew/vendor/"
end
if ENV["HOMEBREW_INTEGRATION_TEST"]
SimpleCov.command_name ENV["HOMEBREW_INTEGRATION_TEST"]
SimpleCov.at_exit do
exit_code = $!.nil? ? 0 : $!.status
$stdout.reopen("/dev/null")
SimpleCov.result # Just save result, but don't write formatted output.
exit! exit_code
end
end
# Don't use Coveralls outside of CI, as it will override SimpleCov's default
# formatter causing the `index.html` not to be written once all tests finish.
if RUBY_VERSION.split(".").first.to_i >= 2 && !ENV["HOMEBREW_INTEGRATION_TEST"] && ENV["CI"]
require "coveralls"
Coveralls.wear!
end