unit-testing - 如何使用 ctest 重新运行失败的测试?

标签 unit-testing testing ctest

我正在使用 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/

相关文章:

python - 在 Python 中对 Corba 进行单元测试

java - 当您想要删除重复代码时,如何解决项目的循环依赖?

javascript - 将迭代和逻辑放在测试中是错误的吗?

unit-testing - 在查看算法时,选择特定种类的覆盖标准背后的基本原理是什么?

testing - 如何在 julia 中为自定义结构创建相等性测试用例

command-line - 如何使用ctest将参数传递给memcheck?

cmake/ctest,valgrind 输出为 xml

cmake - CTest 在子目录中添加测试

c - 单个单元测试应该有多广泛?

testing - 从行中获取元素 (Telerik Test Studio)