Qt Test

Qt Test模块提供编写Qt应用程序和库的单元测试类. 所有的公共方法在QTest命名空间中. 此外, QSignalSpy为Qt的信号和槽函数提供简单的introspection, QAbstractItemModelTester允许对item的模型进行无损检测.

注意: Qt Test模块没有二进制兼容保证. 这表明Qt Test的应用程序只能与对应的Qt版本一起工作. 但是, 源码是兼容的.

开始使用

To enable Qt Test in a project, add this directive into the C++ files:


  #include <QtTest>

To link against Qt Test, add this line to the project file:


  QT += testlib

Articles and Guides

Licenses and Attributions

Qt Test is available under commercial licenses from The Qt Company. In addition, it is available under the GNU Lesser General Public License, version 3, or the GNU General Public License, version 2. See Qt Licensing for further details.

Furthermore Qt Test potentially contains third party modules under following permissive licenses:

Cycle

MIT License

Linux Performance Events

GNU General Public License v2.0 only

Valgrind

BSD 4-clause "Original" or "Old" License

Reference

These are links to the API reference materials.