aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/spec_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb
index 4616d7708..af414b145 100644
--- a/Library/Homebrew/test/spec_helper.rb
+++ b/Library/Homebrew/test/spec_helper.rb
@@ -1,4 +1,5 @@
require "find"
+require "parallel_tests"
require "pathname"
require "rspec/its"
require "rspec/wait"
@@ -6,6 +7,20 @@ require "set"
if ENV["HOMEBREW_TESTS_COVERAGE"]
require "simplecov"
+
+ if ENV["CODECOV_TOKEN"] || ENV["TRAVIS"]
+ require "codecov"
+
+ if ParallelTests.last_process?
+ at_exit do
+ ParallelTests.wait_for_other_processes_to_finish
+
+ puts "Sending coverage report to CodeCov …"
+ formatter = SimpleCov::Formatter::Codecov.new
+ formatter.format SimpleCov::ResultMerger.merged_result
+ end
+ end
+ end
end
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_LIBRARY"]}/Homebrew"))