Skip to content

Commit 2846b91

Browse files
andy31415andreilitvinrestyled-commits
authored
Remove zzz generated and a few more useless directories from clang coverage (#37586)
* Remove zzz_generated from clang coverage report. The 75K lines of untested generated code skews our coverage and results in very small global coverage. Remove it to get likely more accurate 50-60% coverage. * Ignore one more path that is not relevant * Remove more irellevant items * Fix typo * Restyled by autopep8 * Update comment style to be consistent --------- Co-authored-by: Andrei Litvin <andreilitvin@google.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 9acb856 commit 2846b91

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/build/builders/host.py

+9
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,17 @@ def PostBuildCommand(self):
653653
+ ' | xargs -n1 basename | sed "s/\\.profraw//" '
654654
+ f' | xargs -I @ echo -object {shlex.quote(os.path.join(self.output_dir, "tests", "@"))}'
655655
+ f' | xargs -n 10240 llvm-cov export -format=lcov --instr-profile {_indexed_instrumentation} '
656+
# only care about SDK code. third_party is not considered sdk
656657
+ ' --ignore-filename-regex "/third_party/"'
658+
# about 75K lines with almost 0% coverage
659+
+ ' --ignore-filename-regex "/zzz_generated/"'
660+
# generated interface files. about 8K lines with little coverage
661+
+ ' --ignore-filename-regex "/out/.*/Linux/dbus/"'
662+
# 100% coverage for 1K lines, but not relevant (test code)
663+
+ ' --ignore-filename-regex "/out/.*/clang_static_coverage_config/"'
664+
# Tests are likely 100% or close to, want to see only "functionality tested"
657665
+ ' --ignore-filename-regex "/tests/"'
666+
# Ignore system includes
658667
+ ' --ignore-filename-regex "/usr/include/"'
659668
+ ' --ignore-filename-regex "/usr/lib/"'
660669
+ f' | cat >{shlex.quote(_lcov_data)}'

0 commit comments

Comments
 (0)