c++ - 如何从 Catch2 测试用例中访问自定义命令行选项?
问题描述
我使用自定义主文件†添加了我自己的命令行选项:
† https://github.com/catchorg/Catch2/blob/master/docs/own-main.md#adding-your-own-command-line-options
// ...
auto cli
= session.cli() // Get Catch's composite command line parser
| Opt( height, "height" ) // bind variable to a new option, with a hint string
["-g"]["--height"] // the option names it will respond to
("how high?"); // description string for the help output
// ...
}
现在我想height
在测试用例中使用命令行选项。最好的方法是什么?
解决方案
推荐阅读
- sap - 传递 CLOB TO Sys 过程 SAP HANA
- google-app-engine - 与 MongoDB Atlas 等效的 Google App Engine VPC 对等互连
- rabbitmq - 什么时候从队列中删除消息?
- html - 将 LocalStorage 数据动态解析成一张表
- python - pywinAuto - 使用 Windows MFC 控件
- actions-on-google - Google 助理可以访问网络帖子上的音频吗
- php - PHP SQL Server连接工作或不工作
- reactjs - 改进对 React 的错误处理 | 还原 | MERN 应用程序
- html - XSLT:如何避免在 HTML 的属性中添加自闭合标签
- c - 从函数返回多个错误之一并在 C 中结束程序的最佳实践是什么?