【发布时间】:2020-11-14 04:30:27
【问题描述】:
在一个非常简单的测试用例中,如果测试失败,则不会显示 printf() 的输出。我使用 µunit 作为框架,测试例程本身很简单:
static MunitResult test(...)
{
// Some variable initialisation
printf("Test running...\n");
//Do the test
bool bResult = tested_method();
munit_assert(bResult == true);
}
如果我注释掉断言,即测试成功,将显示 printf 输出。不是如果测试失败。运行其他测试例程按预期工作,并正确显示 printf() 的输出。
我这样调用 ctest 来运行测试:
ctest -V --output-on-failure -R '.*nameoftest.*'
整个运行在 Windows 10 上的 docker 容器中。
如何让 ctest 显示测试例程在标准输出上发送的所有输出? 感谢您的帮助,祝您有愉快的一天!
【问题讨论】:
标签: ctest