diff options
| author | Martin Afanasjew | 2016-06-14 14:54:16 +0200 |
|---|---|---|
| committer | GitHub | 2016-06-14 14:54:16 +0200 |
| commit | 86538c9d6ac6fb898a6b2bba30239acc5eabf96c (patch) | |
| tree | ec26c8438ce0db64fe0f76daa56ccdc337dc3642 /Library | |
| parent | 92f51abf597db6323bbc3ffa6eac99fb22336f32 (diff) | |
| download | brew-86538c9d6ac6fb898a6b2bba30239acc5eabf96c.tar.bz2 | |
tests: simplify SimpleCov configuration (#348)
There is no good reason to configure the options specific to integration
tests in a completely different location from all other options.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/test/.simplecov | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/Library/Homebrew/test/.simplecov b/Library/Homebrew/test/.simplecov index f4af3eeba..3dec7d3b7 100644 --- a/Library/Homebrew/test/.simplecov +++ b/Library/Homebrew/test/.simplecov @@ -13,9 +13,17 @@ SimpleCov.start do add_filter "Homebrew/vendor/" add_filter "Taps/" - # Not using this during integration tests makes the tests 4x times faster - # without changing the coverage. - unless ENV["HOMEBREW_INTEGRATION_TEST"] + if ENV["HOMEBREW_INTEGRATION_TEST"] + command_name ENV["HOMEBREW_INTEGRATION_TEST"] + at_exit do + exit_code = $!.nil? ? 0 : $!.status + $stdout.reopen("/dev/null") + SimpleCov.result # Just save result, but don't write formatted output. + exit! exit_code + end + else + # Not using this during integration tests makes the tests 4x times faster + # without changing the coverage. track_files "#{SimpleCov.root}/**/*.rb" end @@ -33,16 +41,6 @@ SimpleCov.start do ] end -if ENV["HOMEBREW_INTEGRATION_TEST"] - SimpleCov.command_name ENV["HOMEBREW_INTEGRATION_TEST"] - SimpleCov.at_exit do - exit_code = $!.nil? ? 0 : $!.status - $stdout.reopen("/dev/null") - SimpleCov.result # Just save result, but don't write formatted output. - exit! exit_code - end -end - # Don't use Coveralls outside of CI, as it will override SimpleCov's default # formatter causing the `index.html` not to be written once all tests finish. if RUBY_VERSION.split(".").first.to_i >= 2 && !ENV["HOMEBREW_INTEGRATION_TEST"] && ENV["CI"] |
