相约 2023 年 BazelCon 将于 10 月 24 日至 25 日在 Google 慕尼黑举办!了解详情

Coverage_common

报告问题 查看源代码

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

会员

instrument_files_info

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

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

参数

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