aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-07-19 10:29:40 +0200
committerBaptiste Fontaine2015-07-20 20:44:12 +0200
commit44a8ebdc7e3714f6f12dd1016ebf752d4a0b270c (patch)
treec77dd6c98d318280e1f20069551f3200dc32f8a9 /Library/Homebrew/test
parent9877b1e7b8e62e8285b459cabe70556c37abfe75 (diff)
downloadbrew-44a8ebdc7e3714f6f12dd1016ebf752d4a0b270c.tar.bz2
'brew tests' optional coverage measure added
Closes Homebrew/homebrew#41890. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/Gemfile1
-rw-r--r--Library/Homebrew/test/Gemfile.lock8
-rw-r--r--Library/Homebrew/test/testing_env.rb16
3 files changed, 25 insertions, 0 deletions
diff --git a/Library/Homebrew/test/Gemfile b/Library/Homebrew/test/Gemfile
index 7c224bd61..b156aab8b 100644
--- a/Library/Homebrew/test/Gemfile
+++ b/Library/Homebrew/test/Gemfile
@@ -3,3 +3,4 @@ source "https://rubygems.org"
gem "mocha", "~> 1.1"
gem "minitest", "~> 5.3"
gem "rake", "~> 10.3"
+gem "simplecov", "~> 0.10.0", :require => false
diff --git a/Library/Homebrew/test/Gemfile.lock b/Library/Homebrew/test/Gemfile.lock
index 5b66cd04e..9663a26c4 100644
--- a/Library/Homebrew/test/Gemfile.lock
+++ b/Library/Homebrew/test/Gemfile.lock
@@ -1,11 +1,18 @@
GEM
remote: https://rubygems.org/
specs:
+ docile (1.1.5)
+ json (1.8.3)
metaclass (0.0.4)
minitest (5.7.0)
mocha (1.1.0)
metaclass (~> 0.0.1)
rake (10.4.2)
+ simplecov (0.10.0)
+ docile (~> 1.1.0)
+ json (~> 1.8)
+ simplecov-html (~> 0.10.0)
+ simplecov-html (0.10.0)
PLATFORMS
ruby
@@ -14,3 +21,4 @@ DEPENDENCIES
minitest (~> 5.3)
mocha (~> 1.1)
rake (~> 10.3)
+ simplecov (~> 0.10.0)
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