From bd573479156feb7a642391c7cede82e8f62d5dad Mon Sep 17 00:00:00 2001 From: Olivier LDff Date: Wed, 21 Aug 2024 11:32:33 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Run=20qml=20test=20in=20flake=20che?= =?UTF-8?q?ck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 8 +++----- tests/CMakeLists.txt | 4 ++-- tests/QOlmTestsQml.cpp | 3 ++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 589e763..b9762af 100644 --- a/flake.nix +++ b/flake.nix @@ -118,11 +118,9 @@ echo "Run shell hook" ${shellHook} - # This used to work with Qt5, but not with Qt6...? - # More investigation needed - # xvfb-run dbus-run-session \ - # --config-file=${pkgs.dbus}/share/dbus-1/session.conf \ - # ctest -C "${cmakeConfigType}" --output-on-failure --verbose + xvfb-run dbus-run-session \ + --config-file=${pkgs.dbus}/share/dbus-1/session.conf \ + ctest -C "${cmakeConfigType}" --output-on-failure --verbose ''; installPhase = '' diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0ea574a..adc1aa8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -26,7 +26,7 @@ set(QOLM_TEST_SRCS ${QOLM_TEST_TARGET_DIR}/Tests.cpp message(STATUS "Add Test: ${QOLM_TEST_TARGET}") # Create the executable -add_executable(${QOLM_TEST_TARGET} ${QOLM_TEST_SRCS}) +qt_add_executable(${QOLM_TEST_TARGET} ${QOLM_TEST_SRCS}) set_target_properties(${QOLM_TEST_TARGET} PROPERTIES AUTOMOC TRUE) target_include_directories(${QOLM_TEST_TARGET} PRIVATE ${QOLM_TEST_TARGET_DIR}/include) target_link_libraries(${QOLM_TEST_TARGET} PRIVATE ${QOLM_TARGET}) @@ -45,7 +45,7 @@ set(QOLM_TEST_QML_SRCS ${QOLM_TEST_TARGET_QML_DIR}/QOlmTestsQml.cpp) message(STATUS "Add Test: ${QOLM_TEST_TARGET_QML}") # Create the executable -add_executable(${QOLM_TEST_TARGET_QML} ${QOLM_TEST_QML_SRCS}) +qt_add_executable(${QOLM_TEST_TARGET_QML} ${QOLM_TEST_QML_SRCS}) set_target_properties(${QOLM_TEST_TARGET_QML} PROPERTIES AUTOMOC TRUE AUTORCC TRUE) target_include_directories(${QOLM_TEST_TARGET_QML} PRIVATE ${QOLM_TEST_TARGET_QML_DIR}/include) target_link_libraries(${QOLM_TEST_TARGET_QML} PRIVATE ${QOLM_TARGET}) diff --git a/tests/QOlmTestsQml.cpp b/tests/QOlmTestsQml.cpp index a6ef7b8..0a425e4 100644 --- a/tests/QOlmTestsQml.cpp +++ b/tests/QOlmTestsQml.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include @@ -22,4 +23,4 @@ public slots: QUICK_TEST_MAIN_WITH_SETUP(QOlmTestsQml, Setup) -#include "QOlmTestsQml.moc" \ No newline at end of file +#include "QOlmTestsQml.moc"