Unit Testing from Qt Creator

preview_player
Показать описание
Do you unit test your application? If not, watch this episode to see how to set it all up.
If you actually do write unit tests, then watch this episode to learn how to get the most out of Qt Creator when running your tests.

0:00 Intro
0:35 Qt's unit test framework compared to other test frameworks
1:21 Qt's unit test framework, test cases and QCOMPARE
3:49 Table driven testing
4:56 Including QTest vs. QtTest
6:08 QTEST_MAIN macro
8:33 Qt Creator integration
11:51 Debugging tests from Qt Creator
13:21 CMake integration

All Qt Widgets and more videos:

About the host:
The video is presented by Jesper Pedersen, who started with Qt back when Qt was widgets only and the version was 1.44, which gives him 21 years of experience with Qt. Since 2000 he has taught almost 100 Qt classes, ranging from Qt Widgets to QML. Heck, Jesper even taught a few classes on QTopia Core — Trolltech's initial attempt at creating a phone stack. Today Jesper holds a fancy business title, but that doesn't prevent him from coding both in his job and in his spare time.

About KDAB:

KDAB experts regularly take time out to deliver KDAB’s world class training, in-house or at open enrollment courses around the world. We are the market leaders for training in Qt, OpenGL and C++.

Рекомендации по теме
Комментарии
Автор

As someone who is just getting familiar with the Qt Test Framework, this video was absolutely invaluable. In short work you explained the whole process with modern Qt tools and now my testing is working great! THANK YOU for the CMake code at the end, especially! This is a really nice feature of Qt Creator!

ezekieloruven
Автор

How do we run same test which you describe in example on iOS or any OS who does not have console. Does Qt Creator give any way to run ?

siddmohsin
Автор

Correction: only private slots run as tests, not all slots, so it does matter if slot is public or private

mugiseyebrows
Автор

I have query. i have written desktop app using pyqt. but did not find much information about Qtest in python

abhishekgoswami
Автор

I cannot see my test cases under QtTest on the Right Column
Not sure what is the issue

keshavbdesai
Автор

Why do you want us to look at the top-left corner all the time? Seriously, black and white main view, only bit of colour is a freaking annoying moving logo. We know who you are. Rant over, back to enjoying the code.

robbybobbyhobbies