我正在使用 CTest 来启动我的项目的测试。我只想启动上次执行时失败的测试。
有没有一种简单的方法可以用 CTest 做到这一点?
最佳答案
CMake 3.0 中的 CTest 添加了 --rerun-failed
选项:
--rerun-failed
Run only the tests that failed previously
This option tells ctest to perform only the tests that failed
during its previous run. When this option is specified, ctest
ignores all other options intended to modify the list of tests
to run (-L, -R, -E, -LE, -I, etc). In the event that CTest runs
and no tests fail, subsequent calls to ctest with the
--rerun-failed option will run the set of tests that most
recently failed (if any).
引用资料:
关于unit-testing - 如何使用 ctest 重新运行失败的测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13547175/