From c6983aade9082091722f7d4bc7024b88fae3f0bc Mon Sep 17 00:00:00 2001
From: Martin Afanasjew <martin@afanasjew.de>
Date: Sun, 17 Jul 2016 16:27:54 +0200
Subject: [PATCH] tests: strip Homebrew prefix from coverage report

Make `Library/Homebrew` the new root now that *all* implementation files
are in this directory. Update filters/groups accordingly.

Note that paths in filters/groups are not anchored at the root and are
always matched against the full path. Our rules are effectively anchored
because they always include the `/Homebrew/` path component.
---
 Library/Homebrew/test/.simplecov | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/Library/Homebrew/test/.simplecov b/Library/Homebrew/test/.simplecov
index b3f87cfdb7..19363a01ee 100644
--- a/Library/Homebrew/test/.simplecov
+++ b/Library/Homebrew/test/.simplecov
@@ -5,13 +5,11 @@ SimpleCov.start do
 
   minimum_coverage 40 unless ENV["HOMEBREW_TESTS_ONLY"]
   coverage_dir File.expand_path("#{tests_path}/coverage")
-  root File.expand_path("#{tests_path}/../../")
+  root File.expand_path("#{tests_path}/..")
 
-  add_filter "Formula/"
-  add_filter "Homebrew/compat/"
-  add_filter "Homebrew/test/"
-  add_filter "Homebrew/vendor/"
-  add_filter "Taps/"
+  add_filter "/Homebrew/compat/"
+  add_filter "/Homebrew/test/"
+  add_filter "/Homebrew/vendor/"
 
   if ENV["HOMEBREW_INTEGRATION_TEST"]
     command_name ENV["HOMEBREW_INTEGRATION_TEST"]
@@ -31,7 +29,7 @@ SimpleCov.start do
   project_name "Homebrew"
   add_group "Commands", %w[/Homebrew/cmd/ /Homebrew/dev-cmd/]
   add_group "Extensions", "/Homebrew/extend/"
-  add_group "OS", "/Homebrew/os/"
+  add_group "OS", %w[/Homebrew/extend/os/ /Homebrew/os/]
   add_group "Requirements", "/Homebrew/requirements/"
   add_group "Scripts", %w[
     /Homebrew/brew.rb
-- 
GitLab