我正在使用 CTest 运行用 cmocka 编写的测试。我想知道是否可以让 CTest 从我的 cmocka 源中读取测试名称并在输出中将它们提供给我。例如,如果我的测试源包含 3 个测试:和test_order_correct
,如果我将这些测试构建到一个名为的可执行文件中并使用 CTest 运行它,我得到的唯一输出是:test_order_received
test_customer_happy
tests
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 不能像那样深入研究源代码?当我输入这个时,这个词似乎越来越不可能。