aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2015-07-27 21:50:30 +0100
committerMike McQuaid2015-07-28 10:57:56 +0100
commit95658a5beb4b2d4cff8947a711661cb8a4645358 (patch)
treef189e14c1f5324d426a8cc3621f565ef1f136100 /Library/Homebrew
parent76a0b1d494283865576c66f4ffec5ab691234280 (diff)
downloadbrew-95658a5beb4b2d4cff8947a711661cb8a4645358.tar.bz2
Move simplecov configuration to dotfile.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/test/.simplecov24
-rw-r--r--Library/Homebrew/test/testing_env.rb18
2 files changed, 25 insertions, 17 deletions
diff --git a/Library/Homebrew/test/.simplecov b/Library/Homebrew/test/.simplecov
new file mode 100644
index 000000000..9e0012faf
--- /dev/null
+++ b/Library/Homebrew/test/.simplecov
@@ -0,0 +1,24 @@
+# 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 "Homebrew/test/"
+ add_filter "vendor/bundle/"
+ add_filter "Homebrew/vendor/"
+ add_filter "Homebrew/compat/"
+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
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb
index a970f5fe8..e5913627a 100644
--- a/Library/Homebrew/test/testing_env.rb
+++ b/Library/Homebrew/test/testing_env.rb
@@ -1,23 +1,7 @@
$:.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/"
- add_filter "Homebrew/compat/"
- end
-end
-
+require "simplecov" if ENV["HOMEBREW_TESTS_COVERAGE"]
require "global"
# Test environment setup