CTest ベースのテストの作成

CTest は、テストフレームワークに関係なく、CMake ベースのプロジェクトのテストを実行することができます。テストはプロジェクトファイル、通常はCMakeLists.txt で設定します。基本的には、プロジェクトのテストを有効にして、テストアプリケーションや特別なコマンドを登録します。

enable_testing()
add_test(NAME test_example COMMAND test_example)

テストとして登録する前に、test_example を実行可能ファイルとして追加します。引数を含む実行可能コマンドであれば何でもかまいません。

CTestの使い方については、CTestを使ったテストを参照してください。

また、 How toも参照してください: How to:Test(テスト方法)」、「Select the build system(ビルド・システムの選択)」、「Testing(テスト)」も参照のこと。

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.