不使用通用过滤器进行多项测试
我有一个名为 builtin_functions
和 design_variables
的测试,如何才能只运行这两个测试而不运行其他测试。
我天真地尝试了 cargo testbuiltin_functions,design_variables
和 cargo testbuiltin_functions design_variables
但都不起作用。
我能做些什么?
I have a test named builtin_functions
and design_variables
how can I run only these two tests and nothing else.
I have naively tried cargo test builtin_functions,design_variables
and cargo test builtin_functions design_variables
but neither work.
What can I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,只有两种方法可以实现您指定的行为,但两种方法都不是很好。您可以键入
,有效地调用该函数两次
或者您可以添加一个明显任意的前缀,在运行它们之前只有这两个测试才会有,例如
它们只需调用
Which 将运行名称中包含
foo
的所有测试,调用这两个测试两个测试都是同步进行的,这是默认行为,但显然需要更多的深思熟虑。
Unfortunately, there are only two ways of getting the behavior you specified, neither of them great. You could type
,effectively calling the function twice
or you could add an apparently arbitrary prefix that only these two tests would have before you run them, such as
and them simply call
Which would run all tests that contain
foo
in their name calling bothboth tests synchronously, as is the default behavior, but obviously requires more forethought.