From 98ddb93dfe83d8e20425f70c711cf61542c67819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Sat, 17 Nov 2018 09:48:51 +0100 Subject: [PATCH] Unset all env variables related to KDE session in integration tests Summary: When running ctest in my session a few OpenGL/waylandonly tests crashed on tear down. This does neither happen on build.kde.org nor when running ctest in a tty. Comparing the env variables of tty and session pointed to the session variables. Unsetting those makes the test not crash. This makes sense as e.g. plasma-integration no longer gets loaded. As our test suite is intended to test KWin and not plasma-integration or gnome integration we should have a clean and reproducable environment, so the variables are unset. Test Plan: 100% tests passed, 0 tests failed out of 130 Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D16939 --- autotests/integration/kwin_wayland_test.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h index a92fd04bad..2c6b921314 100644 --- a/autotests/integration/kwin_wayland_test.h +++ b/autotests/integration/kwin_wayland_test.h @@ -193,6 +193,10 @@ int main(int argc, char *argv[]) \ setenv("QT_QPA_PLATFORM", "wayland-org.kde.kwin.qpa", true); \ setenv("QT_QPA_PLATFORM_PLUGIN_PATH", QFileInfo(QString::fromLocal8Bit(argv[0])).absolutePath().toLocal8Bit().constData(), true); \ setenv("KWIN_FORCE_OWN_QPA", "1", true); \ + qunsetenv("KDE_FULL_SESSION"); \ + qunsetenv("KDE_SESSION_VERSION"); \ + qunsetenv("XDG_SESSION_DESKTOP"); \ + qunsetenv("XDG_CURRENT_DESKTOP"); \ DPI; \ KWin::WaylandTestApplication app(OperationMode, argc, argv); \ app.setAttribute(Qt::AA_Use96Dpi, true); \