简体   繁体   English

C ++项目中的通用参数搜索

[英]Generic Parameter Search in C++ Projects

In several C++ projects I needed to tune a parameter like this: 在几个C ++项目中,我需要像这样调整参数:

Adapt a constant -> Compile -> Run -> Collect results 修改常量->编译->运行->收集结果

What is the best way to automate it? 自动化的最佳方法是什么? The most primitive version would be to have a bash script. 最原始的版本将是一个bash脚本。 It clones the project's git repository, uses sed to change parameters, compiles and runs the application. 它克隆项目的git存储库,使用sed更改参数,编译并运行该应用程序。 After it ran all it collects the results. 运行完后,它将收集结果。

What is the best way to implement that? 最好的实现方法是什么? Are there good frameworks? 有没有好的框架? Are there better ways to do that? 有更好的方法吗?

如果您不喜欢脚本,也许您可​​以尝试一些单元测试框架,例如google test ,它使您可以更方便地运行具有不同数据集的程序,并且可以使用许多MACRO来测试结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM