我使用自定义主文件†添加了我自己的命令行选项:
† 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
在测试用例中使用命令行选项。最好的方法是什么?