From c36f9d29806da291e849a6784d436439bc14455d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Mon, 5 Nov 2018 14:08:12 +0100 Subject: [PATCH] Fix test of scriptedeffectsloader when run from build directory without install Summary: On build.kde.org all tests loading scripted effects are failing. This seems to be because the effects are not installed. To make this work, this change introduces the following changes: * scripted effects are copied to ${build}/bin, like all binaries * the test sets XDG_DATA_DIRS env variable to point to ${build}/bin This change also needs to be added to further tests once this is accepted. Furthermore it could be considered whether KPackageLoader should consider the QCoreApplication::applicationDirPath in addition to the GenericDataLocation. This would make KPackageLoader work much better in a build tree only setup. Test Plan: Test passes locally, obviously not tried on build.kde.org Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D16682 --- autotests/test_scripted_effectloader.cpp | 1 + effects/dialogparent/package/CMakeLists.txt | 2 ++ effects/eyeonscreen/package/CMakeLists.txt | 2 ++ effects/fade/CMakeLists.txt | 2 ++ effects/fadedesktop/CMakeLists.txt | 2 ++ effects/frozenapp/package/CMakeLists.txt | 2 ++ effects/login/package/CMakeLists.txt | 2 ++ effects/logout/package/CMakeLists.txt | 2 ++ effects/maximize/package/CMakeLists.txt | 2 ++ effects/scale/package/CMakeLists.txt | 2 ++ effects/squash/package/CMakeLists.txt | 2 ++ effects/translucency/package/CMakeLists.txt | 2 ++ 12 files changed, 23 insertions(+) diff --git a/autotests/test_scripted_effectloader.cpp b/autotests/test_scripted_effectloader.cpp index 210db6c06b..88ec70ec9f 100644 --- a/autotests/test_scripted_effectloader.cpp +++ b/autotests/test_scripted_effectloader.cpp @@ -91,6 +91,7 @@ private Q_SLOTS: void TestScriptedEffectLoader::initTestCase() { + qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8()); auto config = KSharedConfig::openConfig(QString(), KConfig::SimpleConfig); QCoreApplication::instance()->setProperty("config", QVariant::fromValue(config)); } diff --git a/effects/dialogparent/package/CMakeLists.txt b/effects/dialogparent/package/CMakeLists.txt index 44c284a9c8..a993129857 100644 --- a/effects/dialogparent/package/CMakeLists.txt +++ b/effects/dialogparent/package/CMakeLists.txt @@ -4,3 +4,5 @@ install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effe install(FILES metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_dialogparent.desktop) + +file(COPY contents metadata.desktop DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_dialogparent) diff --git a/effects/eyeonscreen/package/CMakeLists.txt b/effects/eyeonscreen/package/CMakeLists.txt index 37dc0c7d2f..7c7f0c92ef 100644 --- a/effects/eyeonscreen/package/CMakeLists.txt +++ b/effects/eyeonscreen/package/CMakeLists.txt @@ -4,3 +4,5 @@ install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effe install(FILES metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_eyeonscreen.desktop) + +file(COPY contents metadata.desktop DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_eyeonscreen) diff --git a/effects/fade/CMakeLists.txt b/effects/fade/CMakeLists.txt index 35dc6c0e52..b84b58bace 100644 --- a/effects/fade/CMakeLists.txt +++ b/effects/fade/CMakeLists.txt @@ -4,3 +4,5 @@ install(DIRECTORY package/ install(FILES package/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_fade.desktop) + +file(COPY package/ DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_fade) diff --git a/effects/fadedesktop/CMakeLists.txt b/effects/fadedesktop/CMakeLists.txt index 8926da46be..22fe9f9257 100644 --- a/effects/fadedesktop/CMakeLists.txt +++ b/effects/fadedesktop/CMakeLists.txt @@ -4,3 +4,5 @@ install(DIRECTORY package/ install(FILES package/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_fadedesktop.desktop) + +file(COPY package/ DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_fadedesktop) diff --git a/effects/frozenapp/package/CMakeLists.txt b/effects/frozenapp/package/CMakeLists.txt index e426a84b20..7ea3aea3f1 100644 --- a/effects/frozenapp/package/CMakeLists.txt +++ b/effects/frozenapp/package/CMakeLists.txt @@ -4,3 +4,5 @@ install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effe install(FILES metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_frozenapp.desktop) + +file(COPY contents metadata.desktop DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_frozenapp) diff --git a/effects/login/package/CMakeLists.txt b/effects/login/package/CMakeLists.txt index 5e8c10c9ad..82c816931e 100644 --- a/effects/login/package/CMakeLists.txt +++ b/effects/login/package/CMakeLists.txt @@ -4,3 +4,5 @@ install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effe install(FILES metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_login.desktop) + +file(COPY contents metadata.desktop DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_login) diff --git a/effects/logout/package/CMakeLists.txt b/effects/logout/package/CMakeLists.txt index 885e3dbbe5..c44afa779f 100644 --- a/effects/logout/package/CMakeLists.txt +++ b/effects/logout/package/CMakeLists.txt @@ -4,3 +4,5 @@ install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effe install(FILES metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_logout.desktop) + +file(COPY contents metadata.desktop DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_logout) diff --git a/effects/maximize/package/CMakeLists.txt b/effects/maximize/package/CMakeLists.txt index e1262fad8e..72b4513033 100644 --- a/effects/maximize/package/CMakeLists.txt +++ b/effects/maximize/package/CMakeLists.txt @@ -4,3 +4,5 @@ install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effe install(FILES metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_maximize.desktop) + +file(COPY contents metadata.desktop DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_maximize) diff --git a/effects/scale/package/CMakeLists.txt b/effects/scale/package/CMakeLists.txt index 38efbd346f..5ea8bcc3e5 100644 --- a/effects/scale/package/CMakeLists.txt +++ b/effects/scale/package/CMakeLists.txt @@ -7,3 +7,5 @@ install(FILES metadata.desktop install(FILES metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_scale.desktop) + +file(COPY contents metadata.desktop DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_scale) diff --git a/effects/squash/package/CMakeLists.txt b/effects/squash/package/CMakeLists.txt index 99be93cbf8..50dbe59859 100644 --- a/effects/squash/package/CMakeLists.txt +++ b/effects/squash/package/CMakeLists.txt @@ -7,3 +7,5 @@ install(FILES metadata.desktop install(FILES metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_squash.desktop) + +file(COPY contents metadata.desktop DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_squash) diff --git a/effects/translucency/package/CMakeLists.txt b/effects/translucency/package/CMakeLists.txt index 2607a15d6f..4dbf1533b0 100644 --- a/effects/translucency/package/CMakeLists.txt +++ b/effects/translucency/package/CMakeLists.txt @@ -4,3 +4,5 @@ install(FILES metadata.desktop DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/effe install(FILES metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_effect_translucency.desktop) + +file(COPY contents metadata.desktop DESTINATION ${CMAKE_BINARY_DIR}/bin/kwin/effects/kwin4_effect_translucency)