覆盖率

用于访问与覆盖范围相关的基础架构的帮助函数。

成员

instrumented_files_info

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

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

参数

参数 说明
ctx 必需
规则上下文。
source_attributes default = []
属性名称列表,其中包含按此规则处理的源文件。
dependency_attributes default = []
可能会提供运行时依赖项(代码依赖项或 runfile)的属性名称列表。
extensions sequence of strings; or None; 默认值 = 无
用于根据 source_attributes 过滤文件的文件扩展名。例如,“js”。如果未提供(或 None),则 source_attributes 中的所有文件都将添加到插桩文件中;如果提供空列表,则不会添加来自源属性的文件。