Running Qt Quick and CPP tests at the same time
-
I am trying to run Qt Quick and C++ test at the same time, but I keep getting
tst_settings.mocnot found.Folder structure looks like this (screenshot):

*.procontains:CONFIG += warn_on qmltestcase TEMPLATE = app DISTFILES += \ tst_idontknow.qml SOURCES += \ main.cpp \ tst_Settings.cpp INCLUDEPATH += ../<path to external folder>main.cppconatins:#include <QtQuickTest/quicktest.h> QUICK_TEST_MAIN(example)tst_Settings.cppcontains:#include <QObject> #include <QtQuickTest> #include "App/UserInterface/Settings.h" #include "App/UserInterface/ErdBridge.h" class TestSettings: public QObject { Q_OBJECT public: TestSettings(); ~TestSettings(); void test_getTimeFormat24hour(); private: ErdBridge *erdBridget; Settings *settings; }; TestSettings::TestSettings() { settings = new Settings(erdBridget, nullptr); } TestSettings::~TestSettings() { delete settings; delete erdBridget; } void TestSettings::test_getTimeFormat24hour() { QCOMPARE(settings->getTimeFormat24hour(), false); } QUICK_TEST_MAIN_WITH_SETUP(example, TestSettings) #include "tst_settings.moc"tst_idontknow.qmlhas a generated code, which will always pass. When I run the code I get the following error:..\Test_cook-ui-modular-qt\tst_Settings.cpp:39:10: fatal error: tst_settings.moc: No such file or directory 39 | #include "tst_settings.moc" | ^~~~~~~~~~~~~~~~~~ compilation terminated. mingw32-make[1]: *** [Makefile.Debug:1030: debug/tst_Settings.o] Error 1 mingw32-make[1]: *** Waiting for unfinished jobs.... mingw32-make[1]: Leaving directory 'C:/Users/gollaha/Code/cook-ui-modular-qt/build-Test_cook-ui-modular-qt-Desktop_Qt_6_2_2_MinGW_64_bit-Debug' mingw32-make: *** [Makefile:45: debug] Error 2 11:29:06: The process "C:\Qt\Tools\mingw900_64\bin\mingw32-make.exe" exited with code 2. Error while building/deploying project Test_cook-ui-modular-qt (kit: Desktop Qt 6.2.2 MinGW 64-bit) When executing step "Make"Not sure why I am getting this error. Any help would be appreciated.
-
Upper case vs lower case spelling of test_settings.cpp vs test_Settings.cpp?
Did you run qmake a couple of times as well? I always have to run qmake a few times to get it to produce the moc file.