【问题标题】:CTest pull test names from cmocka sourceCTest 从 cmocka 源中提取测试名称
【发布时间】:2015-11-20 17:21:16
【问题描述】:

我正在使用 CTest 运行用 cmocka 编写的测试。我想知道是否可以让 CTest 从我的 cmocka 源中读取测试名称并在输出中将它们提供给我。例如,如果我的测试源包含 3 个测试:test_order_correct、test_order_received 和 test_customer_happy,如果我将这些测试构建到名为 tests 的可执行文件中并使用 CTest 运行它,我得到的唯一输出是:

Test project .......
    Start 1: tests
1/1 Test #1: tests .........................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.01 sec

我想看看:

Test project .......
    Start 1: test_order_correct
1/3 Test #1: test_order_correct ..........................   Passed    0.00 sec
    Start 2: test_order_received
2/3 Test #2: test_order_received .........................   Passed    0.00 sec
    Start 3: test_customer_happy
3/3 Test #3: test_customer_happy .........................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 3

Total Test time (real) =   0.01 sec

这是可能的,还是 CTest 无法像那样深入研究源代码?当我输入这个时,这个词似乎越来越不可能了。

【问题讨论】:

    标签: ctest cmocka


    【解决方案1】:

    如果您调用“make test”,它只会减少输出。要更详细一点,只需在构建目录中调用“ctest -V”即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-10
      • 2016-04-02
      • 2020-06-11
      • 2014-08-16
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多