~/talk

Quickly Testing Qt Desktop Applications with Approval Tests

Talkat CppCon 2020 · 2020-09-14..09-18· [testing]
slides:none on file

You get a concrete recipe: split the app into a static ui library split so tests link the UI code without changing source, use Catch2 with a custom main that creates QApplication, and apply ApprovalTests.cpp integration to capture table cell text or whole-widget images as golden files. Examples use Qt5 widgets, QTest event helpers and QSignalSpy usage to assert a single emitted signal (value 17) for a GoToLine widget. Fixtures hide fragile findChild access; screenshots are supported but flagged as brittle.

AI-written summary · about

  1. 0:00Introduction
  2. 0:46Speaker background
  3. 2:25The legacy code challenge
  4. 3:41Refactoring for testing
  5. 6:52Automated testing overview
  6. 8:14Setting up the test runner
  7. 10:29Testing with color widgets
  8. 15:39Simulating user interaction
  9. 22:52Improving test maintainability
  10. 28:15Separating logic from UI
  11. 30:15Testing Qt signals and events
  12. 36:46Introduction to approval tests
  13. 44:05Visualizing test results
  14. 46:13Qt testing tools
  15. 49:09Summary and conclusion
  16. 50:24Q&A and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.