New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 813123 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocked on:
issue 816635



Sign in to add a comment

Support excluding certain files and directories from code coverage report

Project Member Reported by liaoyuke@chromium.org, Feb 16 2018

Issue description

Two important use cases:

1. exclude test files.
2. exclude out/ folder, which has a lot of dynamically generated source files, and this can significantly increase the speed of generating reports.
 
I experimented a few things, and here is the core issue:

llvm side only supports including certain files via the SOURCES argument, so in order to exclude certain files, we'd have to first generate a list of all files, and remove those we want to exclude, and then pass the remaining files to llvm, however, due to that Chrome has a huge amount of source files, the length of the list of files passed to llvm is greater than the Argument List Limitation.

Even if the Argument List Limitation thing doesn't exist, another issue is that llvm needs to loop through the list of SOURCES to filter output, which will have performance implications if the list is too large.

I think a more reasonable solution is for llvm side to support wildcard inclusion and exclusion, and I'm working with Max to evaluate the feasibility.

Comment 2 by mmoroz@chromium.org, Feb 26 2018

Blockedon: 816635

Comment 3 by mmoroz@chromium.org, Apr 14 2018

Yuke, looks like the clang roll ( issue 828582 ) is going to stick, so we can start using that feature next week. Do you know which files / folders we can safely always ignore?

Comment 4 by mmoroz@chromium.org, Apr 17 2018

Do not exclude anything by default, but proxy the llvm-cov option for ignoring sources to the script users.

Comment 5 by mmoroz@chromium.org, Apr 17 2018

Labels: Coverage-v1-Blocker
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0e4c8683be42d57926923f939e35e8a0cf506149

commit 0e4c8683be42d57926923f939e35e8a0cf506149
Author: Yuke Liao <liaoyuke@chromium.org>
Date: Wed Apr 18 21:06:59 2018

[Coverage] Add ignore_filename_regex argument to coverage script.

This argument enables excluding certain files and folders from code
coverage report using regular expression.

Bug:  813123 
Change-Id: I13343645ba1e3e67dfc17932bc97113600a69095
Reviewed-on: https://chromium-review.googlesource.com/1017382
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551822}
[modify] https://crrev.com/0e4c8683be42d57926923f939e35e8a0cf506149/tools/code_coverage/coverage.py

Status: Fixed (was: Started)

Sign in to add a comment