1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-10 17:55:40 +02:00

tests: Fix Qt dependencies.

Partially fixes
<https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/882>.
This follows commit dae92490.

* tests/CMakeLists.txt: Rename QML_LIBS to QT_LIBS, a regression
introduced in d82e382070.  Remove the
dependency on on the Widgets module, now provided via QT_LIBS.
* tests/qml/main.cpp [WITH_WEBENGINE]: Include QtWebEngine modules
conditionally.
(main) [WITH_WEBENGINE]: Initialize webengine conditionally.

Change-Id: I0df4e11ca3571338fb1e8967784dc6f09ca1dfee
This commit is contained in:
Maxim Cournoyer 2022-11-06 20:28:00 -05:00
parent 01c3c32dd8
commit eabbf15681
2 changed files with 6 additions and 5 deletions

View file

@ -1,4 +1,4 @@
find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED QuickTest Widgets Test)
find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED QuickTest Test Widgets)
if(MSVC)
# Download and unpack googletest for windows
@ -15,7 +15,7 @@ else()
endif()
enable_testing(true)
set(QML_TEST_LIBS ${QML_LIBS} Qt::QuickTest Qt::Widgets Qt::Test)
set(QML_TEST_LIBS ${QT_LIBS} Qt::QuickTest Qt::Test Qt::Widgets)
set(TESTS_INCLUDES
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/tests/qml

View file

@ -31,9 +31,10 @@
#include <QQmlEngine>
#include <QQmlContext>
#include <QFontDatabase>
#ifdef WITH_WEBENGINE
#include <QtWebEngineCore>
#include <QtWebEngineQuick>
#endif
#ifdef Q_OS_WIN
#include <windows.h>
#endif
@ -155,9 +156,9 @@ main(int argc, char** argv)
// Adjust the argument count.
argc = std::distance(argv, end);
}
#ifdef WITH_WEBENGINE
QtWebEngineQuick::initialize();
#endif
QTEST_SET_MAIN_SOURCE_PATH
Setup setup(muteDring);
return quick_test_main_with_setup(argc, argv, "qml_test", nullptr, &setup);