1

CTest を使用して、cmocka で記述されたテストを実行しています。CTest に私の cmocka ソースからテスト名を読み取らせ、出力でそれらを提供することが可能かどうかを知りたいです。たとえば、テスト ソースにtest_order_correcttest_order_receivedおよびtest_customer_happyの 3 つのテストが含まれている場合、これらのテストを という実行可能ファイルにビルドし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 はそのようなソースを掘り下げることができませんか? 私がこれをタイプしていると、その言葉ではますます可能性が少なくなっているように思えます。

4

1 に答える 1

2

「make test」を呼び出すと、出力が減少するだけです。より詳細にするには、ビルド ディレクトリで 'ctest -V' を呼び出します。

于 2015-11-23T08:19:53.047 に答える