From c3e712e967bdf0969e94608122678447b0128282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Fri, 14 Dec 2018 06:54:15 +0100 Subject: [PATCH] Fix the X11TimestampUpdateTest Summary: It also searches for the platform plugin, so we need to ensure it finds it in the build directory. This was a regression caused by building all platform plugins in the correct location. Test Plan: strace on the failing test, verified correct plugin is loaded Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D17573 --- autotests/test_x11_timestamp_update.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/autotests/test_x11_timestamp_update.cpp b/autotests/test_x11_timestamp_update.cpp index 9bfbe19e0b..c6169e1ab2 100644 --- a/autotests/test_x11_timestamp_update.cpp +++ b/autotests/test_x11_timestamp_update.cpp @@ -21,6 +21,7 @@ along with this program. If not, see . #include #include +#include #include #include "main.h" @@ -46,7 +47,20 @@ X11TestApplication::X11TestApplication(int &argc, char **argv) { setX11Connection(QX11Info::connection()); setX11RootWindow(QX11Info::appRootWindow()); - initPlatform(KPluginMetaData(QStringLiteral("KWinX11Platform.so"))); + + // move directory containing executable to front, so that KPluginLoader prefers the plugins in + // the build dir over system installed ones + const auto ownPath = libraryPaths().last(); + removeLibraryPath(ownPath); + addLibraryPath(ownPath); + + const auto plugins = KPluginLoader::findPluginsById(QStringLiteral("org.kde.kwin.platforms"), + QStringLiteral("KWinX11Platform")); + if (plugins.empty()) { + quit(); + return; + } + initPlatform(plugins.first()); } X11TestApplication::~X11TestApplication()