From bae08d5188808d30f48bdfc929a67709c95b0b13 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 8 Oct 2017 00:45:18 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20track=20files=20in=20`test`=20a?= =?UTF-8?q?nd=20`vendor`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Homebrew/.simplecov | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/Library/Homebrew/.simplecov b/Library/Homebrew/.simplecov index 23e60faeb0..2d0ba3d501 100755 --- a/Library/Homebrew/.simplecov +++ b/Library/Homebrew/.simplecov @@ -11,11 +11,6 @@ SimpleCov.start do # tests to be dropped. This causes random fluctuations in test coverage. merge_timeout 86400 - add_filter "/Homebrew/compat/" - add_filter "/Homebrew/dev-cmd/tests.rb" - add_filter "/Homebrew/test/" - add_filter "/Homebrew/vendor/" - if ENV["HOMEBREW_INTEGRATION_TEST"] command_name "#{ENV["HOMEBREW_INTEGRATION_TEST"]} (#{$PROCESS_ID})" @@ -35,20 +30,30 @@ SimpleCov.start do command_name "#{command_name} (#{$PROCESS_ID})" # Not using this during integration tests makes the tests 4x times faster # without changing the coverage. - track_files "#{SimpleCov.root}/**/*.rb" + + subdirs = Dir.chdir(SimpleCov.root) { Dir.glob("*") } + .reject { |d| d.end_with?(".rb") || ["test", "vendor"].include?(d) } + .map { |d| "#{d}/**/*.rb" }.join(",") + + track_files "#{SimpleCov.root}/{#{subdirs},*.rb}" end + add_filter %r{^/compat/} + add_filter %r{^/dev-cmd/tests.rb$} + add_filter %r{^/test/} + add_filter %r{^/vendor/} + # 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 + add_group "Cask", %r{^/cask/} + add_group "Commands", [%r{/cmd/}, %r{^/dev-cmd/}] + add_group "Extensions", %r{^/extend/} + add_group "OS", [%r{^/extend/os/}, %r{^/os/}] + add_group "Requirements", %r{^/requirements/} + add_group "Scripts", [ + %r{^/brew.rb$}, + %r{^/build.rb$}, + %r{^/postinstall.rb$}, + %r{^/test.rb$}, ] end