[Interest] Failing to use QUICK_TEST_MAIN_WITH_SETUP

Mitch Curtis mitch.curtis at qt.io
Wed Oct 24 11:10:14 CEST 2018


> -----Original Message-----
> From: Interest <interest-bounces+mitch.curtis=qt.io at qt-project.org> On
> Behalf Of Marc Van Daele
> Sent: Wednesday, 24 October 2018 10:58 AM
> To: interest at qt-project.org
> Subject: [Interest] Failing to use QUICK_TEST_MAIN_WITH_SETUP
> 
> I'm trying to get an answer to https://forum.qt.io/topic/95715/qtest-failing-
> to-use-quick_test_main_with_setup
> (I hope it is not considered impolite to re-post it here )
> 
> 
> Basically I'm looking for a minimal but complete stand-alone example using
> the new QUICK_TEST_MAIN_WITH_SETUP macro.
> I'm using Qt 5.11.2
> 
> Thanks in advance,
> 
> Marc

Hi Marc.

The #include "tst_mytest.moc" is probably what's missing, as without that the QMetaObject::invokeMethod() call will fail. You should change the include to match the cpp file that the Setup type is in. For example, if your .cpp file is Setup.cpp:

#include "Setup.moc"

Sorry that the documentation is lacking here - it really should explain what to name that include. I'll submit a patch for it.


More information about the Interest mailing list