Skip to content
Snippets Groups Projects
Commit eabbf156 authored by Maxim Cournoyer's avatar Maxim Cournoyer
Browse files

tests: Fix Qt dependencies.

Partially fixes
<#882>.
This follows commit dae92490.

* tests/CMakeLists.txt: Rename QML_LIBS to QT_LIBS, a regression
introduced in d82e3820.  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
parent 01c3c32d
No related branches found
No related tags found
No related merge requests found
find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED QuickTest Widgets Test) find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED QuickTest Test Widgets)
if(MSVC) if(MSVC)
# Download and unpack googletest for windows # Download and unpack googletest for windows
...@@ -15,7 +15,7 @@ else() ...@@ -15,7 +15,7 @@ else()
endif() endif()
enable_testing(true) 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 set(TESTS_INCLUDES
${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/tests/qml ${CMAKE_SOURCE_DIR}/tests/qml
......
...@@ -31,9 +31,10 @@ ...@@ -31,9 +31,10 @@
#include <QQmlEngine> #include <QQmlEngine>
#include <QQmlContext> #include <QQmlContext>
#include <QFontDatabase> #include <QFontDatabase>
#ifdef WITH_WEBENGINE
#include <QtWebEngineCore> #include <QtWebEngineCore>
#include <QtWebEngineQuick> #include <QtWebEngineQuick>
#endif
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <windows.h>
#endif #endif
...@@ -155,9 +156,9 @@ main(int argc, char** argv) ...@@ -155,9 +156,9 @@ main(int argc, char** argv)
// Adjust the argument count. // Adjust the argument count.
argc = std::distance(argv, end); argc = std::distance(argv, end);
} }
#ifdef WITH_WEBENGINE
QtWebEngineQuick::initialize(); QtWebEngineQuick::initialize();
#endif
QTEST_SET_MAIN_SOURCE_PATH QTEST_SET_MAIN_SOURCE_PATH
Setup setup(muteDring); Setup setup(muteDring);
return quick_test_main_with_setup(argc, argv, "qml_test", nullptr, &setup); return quick_test_main_with_setup(argc, argv, "qml_test", nullptr, &setup);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment