&quot“ Expect_failure”巴泽尔规则的属性

发布于 2025-02-13 08:42:46 字数 548 浏览 0 评论 0原文

我想为我正在设计的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温暖的光 2025-02-20 08:42:46

Expect_failure用于分析测试框架。它取决于allySistest,并用于验证在某些输入或某些状态下规则是否失败。

这是 docs

expect_failure is use for analysis test framework. It depends on analysistest, and use to verify that a rule fails given certain inputs or in certain state.

Here is the docs

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文