summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-08-28 11:13:55 +0200
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-08-29 07:04:50 +0200
commit8751c06eceee400bc4b92f2a8f51d6381cbc7ee5 (patch)
tree25548f03e6f94df9ec38ddd17ea3711e0bd7fd93
parentfc9c4a04d7359cb00a733c56cf85fc9737c9886d (diff)
downloadqtwayland-8751c06eceee400bc4b92f2a8f51d6381cbc7ee5.tar.gz
Client tests: Set XDG_CURRENT_DESKTOP to avoid platform themes
If the client tests are run from within a desktop environment, the XDG_CURRENT_DESKTOP variable may be set, causing the client to try to load a platform theme for the user's desktop. The tests, however, are running against a mock Wayland compositor, so launching a platform theme that expects to connect to a certain compositor implementation is probably not a good idea. And furthermore, if the gtk3 platform theme is used, it will start binding to interfaces and create wayland objects, confusing our existing test code. Setting XDG_CURRENT_DESKTOP to qtwaylandtests will prevent detection of the (outer) desktop environment, making tests more predictable. Change-Id: I57fa76e51cecdd0cbe8be6bd075ce67e9d2892bc Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r--tests/auto/client/shared/mockcompositor.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/client/shared/mockcompositor.h b/tests/auto/client/shared/mockcompositor.h
index 75ef1eae..05bf32c8 100644
--- a/tests/auto/client/shared/mockcompositor.h
+++ b/tests/auto/client/shared/mockcompositor.h
@@ -78,6 +78,7 @@ public:
int main(int argc, char **argv) \
{ \
setenv("XDG_RUNTIME_DIR", ".", 1); \
+ setenv("XDG_CURRENT_DESKTOP", "qtwaylandtests", 1); \
setenv("QT_QPA_PLATFORM", "wayland", 1); \
test tc; \
QGuiApplication app(argc, argv); \