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

- Test framework で、Google テストにリンクする場合はGoogle Test (shared libraries) を選択し、必要な Google テストソースをプロジェクトに含める場合はGoogle Test (headers only) を選択します。
- Test suite name で、テスト・スイートの名前を入力します。
- Test case name で、テストケースの名前を入力します。
- 共有ライブラリのテストの場合は、Googletest install directory (optional) で、Google C++ テスト・フレームワークのインストー ル先パスを設定します。
- ヘッダーのみのテストの場合は、Googletest source directory (optional) に googletest リポジトリのクローンへのパスを設定します。
- Build system で、プロジェクトのビルドに使用するビルドシステムを選択します:CMake、qmake、または Qbs。
Qt Creator で、指定したプロジェクトディレクトリにテストを作成します。
Google テストの作成についての詳細は、Google テスト入門 を参照ください。
注意: テストをスキャンする際に、パーサが考慮するのはgtest/gtest.h を直接あるいは間接的に含むファイルだけです。現在ビルドされないファイルは無視されます。
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.