6.0.0-rc4Source

Nt Test C++ Classes

Unit testing: test functions, data-driven tests, signal spies and result logs.

Using the Module

target_link_libraries(app PRIVATE Nt::Test)

Nt Test runs the private slots of a QObject as test functions and logs the results. Headers keep Qt's names, so #include <QTest> and #include <QtTest/QSignalSpy> both work.

See Writing Tests with Nt Test for a complete test.

Classes

QSignalSpyThe QSignalSpy class records the emissions of a signal.
QTestThe QTest namespace holds the functions behind Nt Test.
QTestDataThe QTestData class is a row of test data under construction.
QTestEventLoopThe QTestEventLoop class runs an event loop in a test, with a timeout.