aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-01-29 17:23:05 +0000
committerMike McQuaid2017-01-29 17:23:05 +0000
commitf7b19916265ba893c669316c0984085aa069d774 (patch)
treea2634c218e366426e2dee62af23cf58c04a66c61 /Library
parent39ce9c890e3c1cda60b370ff8ac49cd640be90e1 (diff)
downloadbrew-f7b19916265ba893c669316c0984085aa069d774.tar.bz2
Use dedicated upload_coverage script.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Homebrew/.simplecov6
-rwxr-xr-xLibrary/Homebrew/cask/cmd/brew-cask-tests.rb10
-rwxr-xr-xLibrary/Homebrew/cask/test/upload_coverage.rb6
3 files changed, 14 insertions, 8 deletions
diff --git a/Library/Homebrew/.simplecov b/Library/Homebrew/.simplecov
index 9db7b3210..952bb466b 100755
--- a/Library/Homebrew/.simplecov
+++ b/Library/Homebrew/.simplecov
@@ -52,9 +52,3 @@ SimpleCov.start do
/Homebrew/test.rb
]
end
-
-if ENV["CODECOV_TOKEN"] || ENV["TRAVIS"]
- require "codecov"
- formatter = SimpleCov::Formatter::Codecov.new
- formatter.format(SimpleCov::ResultMerger.merged_result)
-end
diff --git a/Library/Homebrew/cask/cmd/brew-cask-tests.rb b/Library/Homebrew/cask/cmd/brew-cask-tests.rb
index 2bff513fe..bdcabd4dc 100755
--- a/Library/Homebrew/cask/cmd/brew-cask-tests.rb
+++ b/Library/Homebrew/cask/cmd/brew-cask-tests.rb
@@ -10,8 +10,8 @@ def run_tests(executable, files, args = [])
system "bundle", "exec", executable, *opts, "--", *args, "--", *files
end
-repo_root = Pathname.new(__FILE__).realpath.parent.parent
-repo_root.cd do
+cask_root = Pathname.new(__FILE__).realpath.parent.parent
+cask_root.cd do
ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1"
ENV["HOMEBREW_NO_EMOJI"] = "1"
ENV.delete("HOMEBREW_CASK_OPTS")
@@ -26,6 +26,7 @@ repo_root.cd do
if ARGV.flag?("--coverage")
ENV["HOMEBREW_TESTS_COVERAGE"] = "1"
+ upload_coverage = ENV["CODECOV_TOKEN"] || ENV["TRAVIS"]
end
failed = false
@@ -47,4 +48,9 @@ repo_root.cd do
end
Homebrew.failed = failed
+
+ if upload_coverage
+ puts "Submitting Codecov coverage..."
+ system "bundle", "exec", "test/upload_coverage.rb"
+ end
end
diff --git a/Library/Homebrew/cask/test/upload_coverage.rb b/Library/Homebrew/cask/test/upload_coverage.rb
new file mode 100755
index 000000000..06d38157d
--- /dev/null
+++ b/Library/Homebrew/cask/test/upload_coverage.rb
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+require "simplecov"
+require "codecov"
+
+formatter = SimpleCov::Formatter::Codecov.new
+formatter.format SimpleCov::ResultMerger.merged_result