[Development] Supporting helper functions in auto tests by providing throwing Qt Test macros

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Fri Apr 5 10:49:47 CEST 2019

Il 05/04/19 10:29, Mitch Curtis ha scritto:
> To take the obvious one first: anyone using their own custom macros in helpers shouldn't be affected (that's me, currently).

But which custom macros, exactly? If your macros expand to private APIs 
usage, we can break that anytime we want.

> Anyone (incorrectly) using Qt macros in helpers shouldn't be affected so long as exceptions are enabled; their tests will just correctly terminate early upon failures in those helpers now.

Exactly, but this is unsupported right now, so we can do a SIC. (If it's 
behind a opt-in / opt-out mechanism, even better).

> Any tests with exceptions explicitly disabled would fail to compile. That might be the biggest issue?

Hopefully we can detect it (e.g. GCC/Clang define __EXCEPTIONS when 
exceptions are enabled), and make our macros return instead of throw, 
i.e. keep the current behaviour and the current limitation of being used 
only directly from a testcase function.

My 2 c,

Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4007 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190405/db7715cf/attachment.bin>

More information about the Development mailing list