From 9033af6bda721c88bdb14f6e18b844ab41bbcb84 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 20 Sep 2016 17:02:35 +0000 Subject: tests, cask-tests: (maybe) fix coverage --- Library/Homebrew/.simplecov | 45 ++++++++++++++++++++++++++++++++++++++++ Library/Homebrew/cask/.simplecov | 2 +- Library/Homebrew/test/.simplecov | 45 ---------------------------------------- 3 files changed, 46 insertions(+), 46 deletions(-) create mode 100755 Library/Homebrew/.simplecov delete mode 100755 Library/Homebrew/test/.simplecov (limited to 'Library') diff --git a/Library/Homebrew/.simplecov b/Library/Homebrew/.simplecov new file mode 100755 index 000000000..7b057e878 --- /dev/null +++ b/Library/Homebrew/.simplecov @@ -0,0 +1,45 @@ +#!/usr/bin/env ruby + +SimpleCov.start do + coverage_dir File.expand_path("../coverage", File.realpath(__FILE__)) + root File.expand_path("../..", File.realpath(__FILE__)) + + # We manage the result cache ourselves and the default of 10 minutes can be + # too low (particularly on Travis CI), causing results from some integration + # tests to be dropped. This causes random fluctuations in test coverage. + merge_timeout 86400 + + add_filter "/Homebrew/cask/spec/" + add_filter "/Homebrew/cask/test/" + add_filter "/Homebrew/compat/" + add_filter "/Homebrew/test/" + add_filter "/Homebrew/vendor/" + + 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 + + # Add groups and the proper project name to the output. + project_name "Homebrew" + add_group "Cask", "/Homebrew/cask/" + add_group "Commands", %w[/Homebrew/cmd/ /Homebrew/dev-cmd/] + add_group "Extensions", "/Homebrew/extend/" + add_group "OS", %w[/Homebrew/extend/os/ /Homebrew/os/] + add_group "Requirements", "/Homebrew/requirements/" + add_group "Scripts", %w[ + /Homebrew/brew.rb + /Homebrew/build.rb + /Homebrew/postinstall.rb + /Homebrew/test.rb + ] +end diff --git a/Library/Homebrew/cask/.simplecov b/Library/Homebrew/cask/.simplecov index d1b045262..75a078be4 120000 --- a/Library/Homebrew/cask/.simplecov +++ b/Library/Homebrew/cask/.simplecov @@ -1 +1 @@ -../test/.simplecov \ No newline at end of file +../.simplecov \ No newline at end of file diff --git a/Library/Homebrew/test/.simplecov b/Library/Homebrew/test/.simplecov deleted file mode 100755 index 7b057e878..000000000 --- a/Library/Homebrew/test/.simplecov +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env ruby - -SimpleCov.start do - coverage_dir File.expand_path("../coverage", File.realpath(__FILE__)) - root File.expand_path("../..", File.realpath(__FILE__)) - - # We manage the result cache ourselves and the default of 10 minutes can be - # too low (particularly on Travis CI), causing results from some integration - # tests to be dropped. This causes random fluctuations in test coverage. - merge_timeout 86400 - - add_filter "/Homebrew/cask/spec/" - add_filter "/Homebrew/cask/test/" - add_filter "/Homebrew/compat/" - add_filter "/Homebrew/test/" - add_filter "/Homebrew/vendor/" - - 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 - - # Add groups and the proper project name to the output. - project_name "Homebrew" - add_group "Cask", "/Homebrew/cask/" - add_group "Commands", %w[/Homebrew/cmd/ /Homebrew/dev-cmd/] - add_group "Extensions", "/Homebrew/extend/" - add_group "OS", %w[/Homebrew/extend/os/ /Homebrew/os/] - add_group "Requirements", "/Homebrew/requirements/" - add_group "Scripts", %w[ - /Homebrew/brew.rb - /Homebrew/build.rb - /Homebrew/postinstall.rb - /Homebrew/test.rb - ] -end -- cgit v1.2.3