aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/testing_env.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/testing_env.rb')
-rw-r--r--Library/Homebrew/test/testing_env.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb
index d960d35d5..60434aded 100644
--- a/Library/Homebrew/test/testing_env.rb
+++ b/Library/Homebrew/test/testing_env.rb
@@ -1,6 +1,22 @@
$:.unshift File.expand_path("../..", __FILE__)
$:.unshift File.expand_path("../lib", __FILE__)
+# This must be at the top
+if ENV["HOMEBREW_TESTS_COVERAGE"]
+ require "simplecov"
+ 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 "Homebrew/test"
+ add_filter "vendor/bundle"
+ add_filter "Homebrew/vendor"
+ end
+end
+
require "global"
# Test environment setup