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 參考材料鏈接。