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
icc-effect-5.17.5
Martin Flöser 2018-11-07 16:09:34 +01:00
parent e637d43211
commit 0e839c4dda
1 changed files with 5 additions and 0 deletions

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