-----Original Message-----
Sent: Wednesday, 24 October 2018 11:43 AM
Subject: Re: [Interest] Failing to use QUICK_TEST_MAIN_WITH_SETUP
Thanks!
Adding #include "main.moc" indeed worked!
I also tried to put Setup.h/cpp in a separate class (and no #include of the
moc) but I couldn't get that one working.
Hmm, I'm not sure why that doesn't work - it should work the same as regular moc'd classes/files. Though it's worth mentioning that I've never seen an auto test (class) that wasn't solely contained within a .cpp file.
Note also that the example on https://doc.qt.io/qt-5.11/qtquicktest-
index.html#executing-c-before-qml-tests is missing a Q_OBJECT!
Nicely spotted, will update the patch. :)
Kind Regards,
Marc
-----Original Message-----
Behalf Of Marc Van Daele
Sent: Wednesday, 24 October 2018 10:58 AM
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
#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.