Tests enabled with -DENABLE_TESTS=ON fail to build
The compilation error looks like:
AutoMoc warning
---------------
"SRC:/src/app/previewengine.cpp"
includes the moc file "previewengine.moc", but does not contain a Q_OBJECT, Q_GADGET, Q_GADGET_EXPORT, Q_NAMESPACE or Q_NAMESPACE_EXPORT macro.
AutoMoc: /home/maxim/src/jami-project/client-qt/src/app/previewengine.cpp:0:1: note: No relevant classes found. No output generated.
[ 84%] Built target test_common_obj_autogen
[ 84%] Building CXX object tests/CMakeFiles/test_common_obj.dir/test_common_obj_autogen/mocs_compilation.cpp.o
In file included from /home/maxim/src/jami-project/client-qt/build4/tests/test_common_obj_autogen/M37QIKJ6ZC/../../../../src/app/lrcinstance.h:29,
from /home/maxim/src/jami-project/client-qt/build4/tests/test_common_obj_autogen/M37QIKJ6ZC/../../../../src/app/abstractlistmodelbase.h:23,
from /home/maxim/src/jami-project/client-qt/build4/tests/test_common_obj_autogen/M37QIKJ6ZC/moc_abstractlistmodelbase.cpp:10,
from /home/maxim/src/jami-project/client-qt/build4/tests/test_common_obj_autogen/mocs_compilation.cpp:2:
/home/maxim/src/jami-project/client-qt/build4/tests/test_common_obj_autogen/M37QIKJ6ZC/../../../../src/app/utils.h:29:10: fatal error: QLabel: No such file or directory
29 | #include <QLabel>
| ^~~~~~~~
compilation terminated.
make[2]: *** [tests/CMakeFiles/test_common_obj.dir/build.make:76: tests/CMakeFiles/test_common_obj.dir/test_common_obj_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:541: tests/CMakeFiles/test_common_obj.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
It seems like the test_common_obj executable lacks the includes of QtWidgets.