ctestcmocka

CTest pull test names from cmocka source


I'm using CTest to run tests written with cmocka. I'd like to know if it's possible to have CTest read the test names from my cmocka source and give them to me on the output. For example, if my test source contains 3 tests: test_order_correct, test_order_received and test_customer_happy, if I build these tests into an executable called tests and I run it with CTest, the only output that I get is:

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

I'd like to see:

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

Is this possible, or is CTest not capable of delving into the source like that? As I type this, it seems less and less possible by the word.


Solution

  • If you call 'make test' it only gives you reduced output. To be more verbose just call 'ctest -V' in the build directory.