&quot“ Expect_failure”巴泽尔规则的属性
我想为我正在设计的Bazel规则集定义一个“ Expect_failure”布尔属性,以便我可以正确编写工具链的测试。但是:
ERROR: /blah/blah.bzl:7:26: cannot add attribute: There is already a built-in attribute 'expect_failure' which cannot be overridden.
我在任何地方都找不到此“内置属性”的文档。当我尝试使用此内置属性时,我发现它是类型的“字符串”而不是“ bool”,这可能意味着其实现的一些细微差别。当我尝试通过将“ Expect_failure”定义为字符串“ true”来天真地使用它时,我会看到一个意外的错误消息:
ERROR: /blah/blah/BUILD:159:21: in _verilog_test rule //blah/blah:blah-test: Expected failure not found: True
有人可以照亮我的内置“ Expect_failure”属性的正确使用?
I want to define an "expect_failure" boolean attribute for a bazel rule set that I'm devising, so I can properly write tests for my tool chain. However:
ERROR: /blah/blah.bzl:7:26: cannot add attribute: There is already a built-in attribute 'expect_failure' which cannot be overridden.
I can't find documentation for this "built-in attribute" anywhere. When I attempt to make use of this built in attribute, I find that it is of type "string" rather than "bool" which maybe implies some nuance to its implementation. When I attempt to naively use it by defining "expect_failure" to be the string "True", I see an unexpected error message:
ERROR: /blah/blah/BUILD:159:21: in _verilog_test rule //blah/blah:blah-test: Expected failure not found: True
Can anyone illuminate correct use of the built-in "expect_failure" attribute for me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Expect_failure
用于分析测试框架。它取决于allySistest
,并用于验证在某些输入或某些状态下规则是否失败。这是 docs
expect_failure
is use for analysis test framework. It depends onanalysistest
, and use to verify that a rule fails given certain inputs or in certain state.Here is the docs