覆盖率

用于访问覆盖率相关基础架构的辅助函数。

成员

instrumented_files_info

InstrumentedFilesInfo coverage_common.instrumented_files_info(ctx, *, source_attributes=[], dependency_attributes=[], extensions=None, metadata_files=[])

创建新的 InstrumentedFilesInfo 实例。使用此提供程序来传达当前 build 规则的覆盖率相关属性。

参数

参数 说明
ctx 必需
规则上下文。
source_attributes 默认值 = []
属性名称列表,其中包含此规则处理的源文件。
dependency_attributes 默认值 = []
可能会提供运行时依赖项(代码依赖项或 runfile)的属性名称列表。
extensions sequence of strings; or None; 默认 = 无
用于从 source_attributes 过滤文件的文件扩展名。例如“js”。如果未提供(或 None),则 source_attributes 中的所有文件都将添加到插桩文件中;如果提供空列表,则系统不会添加源属性中的任何文件。
metadata_files sequence of Files; 默认值 = []
在代码执行后生成覆盖率 LCOV 文件所需的额外文件。例如.gcno 文件(适用于 C++)。