O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing the first acceptance tests in C++

The QtTest framework (http://doc.qt.io/qt-5.9/qttest-index.html, and, in overview, http://doc.qt.io/qt-5.9/qtest-overview.html) is a collection of C++ classes and QML types that provides many tools for writing effective test cases for Qt applications. To create a test case with the C++ API, you should subclass a QObject, and add a method for each test (each method/test corresponding to a BDD scenario).

Qt Creator provides specific templates to generate projects for both single test cases (the Qt Unit Test template) and complete test suites (the Auto Test Project template, which shows up after enabling the AutoTest plugin from the About Plugins... menu entry).

For learning's sake, we'll configure our ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required