创建基于 CTest 的测试
CTest 可以为基于 CMake 的项目执行测试,无论其采用何种测试框架。您需要在项目文件(通常为CMakeLists.txt )中配置测试。基本上,您需要启用项目的测试功能,并注册测试应用程序甚至特殊命令。
enable_testing() add_test(NAME test_example COMMAND test_example)
在尝试将其注册为测试之前,请先将test_example 添加为可执行项。它可以是任何包含参数的可执行命令。
有关如何使用 CTest 的更多信息,请参阅《使用 CTest 进行测试》。
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.