Unset XKB_DEFAULT_* in tests to make tests better reproducable

Summary:
On one of my systems XKB_DEFAULT_LAYOUT is set to "de". This makes a few
tests fail, e.g. pointer input and modifier only shortcuts.

The reason is that those tests assume the xkb default layout behavior,
that is how xkb functions without any layout being set. So having the
env variable around influences the layout generation.

To prevent this the environment variables are unset and thus a
reproducable environment is created.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16737
This commit is contained in:
Martin Flöser 2018-11-07 16:09:34 +01:00
parent e637d43211
commit 0e839c4dda

View file

@ -53,6 +53,11 @@ WaylandTestApplication::WaylandTestApplication(OperationMode mode, int &argc, ch
setUseKActivities(false);
#endif
qputenv("KWIN_COMPOSE", QByteArrayLiteral("Q"));
qunsetenv("XKB_DEFAULT_RULES");
qunsetenv("XKB_DEFAULT_MODEL");
qunsetenv("XKB_DEFAULT_LAYOUT");
qunsetenv("XKB_DEFAULT_VARIANT");
qunsetenv("XKB_DEFAULT_OPTIONS");
initPlatform(KPluginMetaData(QStringLiteral("KWinWaylandVirtualBackend.so")));
WaylandServer::create(this);
}