From 8751c06eceee400bc4b92f2a8f51d6381cbc7ee5 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 28 Aug 2019 11:13:55 +0200 Subject: 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 Reviewed-by: Paul Olav Tvete --- tests/auto/client/shared/mockcompositor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/client/shared/mockcompositor.h b/tests/auto/client/shared/mockcompositor.h index 75ef1eaea..05bf32c8d 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); \ -- cgit v1.2.3