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
This commit is contained in:
Martin Flöser 2018-11-05 14:08:12 +01:00
parent a04b9da61e
commit c36f9d2980
12 changed files with 23 additions and 0 deletions

View file

@ -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));
}

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)