1 Star 0 Fork 0

herolin12/protobuf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
cc_proto_blacklist_test.bzl 999 Bytes
一键复制 编辑 原始数据 按行查看 历史
"""Contains a unittest to verify that `cc_proto_library` does not generate code for blacklisted `.proto` sources (i.e. WKPs)."""
load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest")
def _cc_proto_blacklist_test_impl(ctx):
"""Verifies that there are no C++ compile actions for Well-Known-Protos.
Args:
ctx: The rule context.
Returns: A (not further specified) sequence of providers.
"""
env = unittest.begin(ctx)
for dep in ctx.attr.deps:
files = len(dep.files.to_list())
asserts.equals(
env,
0,
files,
"Expected that target '{}' does not provide files, got {}".format(
dep.label,
files,
),
)
return unittest.end(env)
cc_proto_blacklist_test = unittest.make(
impl = _cc_proto_blacklist_test_impl,
attrs = {
"deps": attr.label_list(
mandatory = True,
providers = [CcInfo],
),
},
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/herolin12/protobuf.git
git@gitee.com:herolin12/protobuf.git
herolin12
protobuf
protobuf
master

搜索帮助