diff --git a/autotests/test_x11_timestamp_update.cpp b/autotests/test_x11_timestamp_update.cpp --- a/autotests/test_x11_timestamp_update.cpp +++ b/autotests/test_x11_timestamp_update.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include "main.h" @@ -46,7 +47,20 @@ { 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()