diff options
| author | Baptiste Fontaine | 2016-02-06 18:40:40 +0100 |
|---|---|---|
| committer | Baptiste Fontaine | 2016-02-07 11:52:26 +0100 |
| commit | 115e6b49bcfe1a6b32d52fb873af284a0750a1cb (patch) | |
| tree | 8ee8bb5400db32ed79c257eeae490e3c594417d2 /Library | |
| parent | 4ce99fa0102c352f79071d8ae6aa64078ed1493d (diff) | |
| download | brew-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')
| -rw-r--r-- | Library/Homebrew/test/lib/integration_mocks.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds.rb | 2 |
2 files changed, 9 insertions, 1 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 diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb index a9f6517f8..c6a4702c6 100644 --- a/Library/Homebrew/test/test_integration_cmds.rb +++ b/Library/Homebrew/test/test_integration_cmds.rb @@ -28,7 +28,6 @@ class IntegrationCommandTests < Homebrew::TestCase -W0 -I#{HOMEBREW_LIBRARY_PATH}/test/lib -rconfig - -rintegration_mocks ] if ENV["HOMEBREW_TESTS_COVERAGE"] # This is needed only because we currently use a patched version of @@ -38,6 +37,7 @@ class IntegrationCommandTests < Homebrew::TestCase cmd_args << "-rbundler/setup" cmd_args << "-rsimplecov" end + cmd_args << "-rintegration_mocks" cmd_args << (HOMEBREW_LIBRARY_PATH/"../brew.rb").resolved_path.to_s cmd_args += args Bundler.with_original_env do |
