Qt Test

Qt Test 提供对 Qt 应用程序和库进行单元测试的类。所有公共方法都在 QTest 名称空间。此外, QSignalSpy class provides easy introspection for Qt's signals and slots.

快速入门

要在工程中启用 Qt Test,添加此伪指令到 C++ 文件:

#include <QtTest>
					

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

QT += testlib
					

文章和指南

许可和归属

Qt Test 模块在商业许可下是可用的来自 Qt 公司 。此外,它在自由软件许可下也是可用的。从 Qt 5.4 起,这些自由软件许可是 GNU LGPL (次一般公共许可) 第 3 版 ,或 GNU GPL (一般公共许可) 第 2 版 。见 Qt 许可 进一步了解细节。

Furthermore, Qt Test in Qt 5.9.9 may contain third party modules under following permissive licenses:

Cycle

MIT 许可

Linux Performance Events

GNU General Public License v2.0 only

Valgrind

BSD 4 条款原始或旧的许可

参考

这些是 API 参考材料链接。