Boostテストの作成

Boostテストをビルドして実行するには、コンピュータにBoost.Testをインストールします。通常、BoostのインストールにはBoost.Testが含まれています。Boost.orgからBoostをダウンロードします。

コンパイラとビルド・システムがBoostライブラリを見つけることができれば、テストの作成時にインクルード・ディレクトリを指定する必要はありません。

Boostテストを作成するには

  1. File >New Project >Test Project にアクセスする。
  2. Boost Test Project >Choose を選択して、Boost テスト用の定型コードを含むプロジェクトを作成します。
  3. Project and Test Information ダイアログで、プロジェクトとテストの設定を指定します:

    Boost Test ProjectウィザードのProject and Test Informationダイアログ

    1. Test framework で、必要なヘッダーを含めるにはBoost Test (header only) を選択し、Boost Test に対してリンクするにはBoost Test (shared libraries) を選択します。
    2. Test suite name で、テスト・スイートの名前を入力します。
    3. Test case name に、テストケースの名前を入力します。
    4. Boost include directory (optional) には、version.hpp やテスト・ヘッダ・ファイルを含むtest サブフォルダなど、Boost.Test が必要とするファイルを含むディレクトリへのパスを入力します。
    5. Build system では、プロジェクトのビルドに使用するビルド・システムを選択します:CMake、qmake、または Qbs。

Qt Creator で、プロジェクト・ディレクトリにテストを作成します。

Boost テストの作成に関する詳細は、Boost.Test を参照してください。

注意: テストをスキャンする際、パーサーはBoostのテストライブラリヘッダーの1つを直接または間接的に含むファイル(boost/test/ で始まり、.hpp の接尾辞を持つインクルード)のみを考慮します。現在ビルドされないファイルは無視されます。

How To: Test」、「Select the build system」、「Testing」、「Test Results」も参照してください

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.