aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/lib
diff options
context:
space:
mode:
authorBaptiste Fontaine2016-02-06 18:40:40 +0100
committerBaptiste Fontaine2016-02-07 11:52:26 +0100
commit115e6b49bcfe1a6b32d52fb873af284a0750a1cb (patch)
tree8ee8bb5400db32ed79c257eeae490e3c594417d2 /Library/Homebrew/test/lib
parent4ce99fa0102c352f79071d8ae6aa64078ed1493d (diff)
downloadbrew-115e6b49bcfe1a6b32d52fb873af284a0750a1cb.tar.bz2
tests: monkey-patch exec to get coverage reports
Closes Homebrew/homebrew#48923. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library/Homebrew/test/lib')
-rw-r--r--Library/Homebrew/test/lib/integration_mocks.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/test/lib/integration_mocks.rb b/Library/Homebrew/test/lib/integration_mocks.rb
index 322163a8e..6effb0cde 100644
--- a/Library/Homebrew/test/lib/integration_mocks.rb
+++ b/Library/Homebrew/test/lib/integration_mocks.rb
@@ -6,4 +6,12 @@ module Homebrew
end
end
end
+
+ def exec(*args)
+ if ENV["HOMEBREW_TESTS_COVERAGE"] && ENV["HOMEBREW_INTEGRATION_TEST"]
+ # Ensure we get coverage results before replacing the current process.
+ SimpleCov.result
+ end
+ Kernel.exec(*args)
+ end
end