Boost テストを作成する

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

コンパイラとビルドシステムが Boost ライブラリを自動的に検出できる場合は、テストを作成する際にインクルードディレクトリを指定する必要はありません。

Boost テストを作成するには:

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

    Boost テストプロジェクトウィザードの「プロジェクトとテストの情報」ダイアログ

    1. Test framework 」で、「Boost Test (header only) 」を選択して必要なヘッダーを含めるか、「Boost Test (shared libraries) 」を選択して Boost Test に対してリンクします。
    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 のテストライブラリヘッダー(boost/test/ で始まり、.hpp というサフィックスを持つもの)を直接または間接的にインクルードしているファイルのみを考慮します。現在ビルドされないファイルは無視されます。

「ハウツー:テスト」、「ビルドシステムの選択」、「テストも参照してください

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.