diff --git a/tests/auto/wayland/client/tst_client.cpp b/tests/auto/wayland/client/tst_client.cpp index 83b9e6ce0b3..e7729ce8b20 100644 --- a/tests/auto/wayland/client/tst_client.cpp +++ b/tests/auto/wayland/client/tst_client.cpp @@ -507,7 +507,8 @@ void tst_WaylandClient::longWindowTitleWithUtf16Characters() int main(int argc, char **argv) { - setenv("XDG_RUNTIME_DIR", ".", 1); + QTemporaryDir tmpRuntimeDir; + setenv("XDG_RUNTIME_DIR", tmpRuntimeDir.path().toLocal8Bit(), 1); setenv("QT_QPA_PLATFORM", "wayland", 1); // force QGuiApplication to use wayland plugin MockCompositor compositor; diff --git a/tests/auto/wayland/inputcontext/tst_inputcontext.cpp b/tests/auto/wayland/inputcontext/tst_inputcontext.cpp index b1a5a7f17f8..3e6de4a0800 100644 --- a/tests/auto/wayland/inputcontext/tst_inputcontext.cpp +++ b/tests/auto/wayland/inputcontext/tst_inputcontext.cpp @@ -173,7 +173,8 @@ void tst_inputcontext::inputContextReconfigurationWhenTogglingTextInputExtension int main(int argc, char *argv[]) { - qputenv("XDG_RUNTIME_DIR", "."); + QTemporaryDir tmpRuntimeDir; + qputenv("XDG_RUNTIME_DIR", tmpRuntimeDir.path().toLocal8Bit()); qputenv("QT_QPA_PLATFORM", "wayland"); tst_inputcontext tc; diff --git a/tests/auto/wayland/shared/mockcompositor.h b/tests/auto/wayland/shared/mockcompositor.h index 05bf32c8d50..f5264ccf611 100644 --- a/tests/auto/wayland/shared/mockcompositor.h +++ b/tests/auto/wayland/shared/mockcompositor.h @@ -77,7 +77,8 @@ public: #define QCOMPOSITOR_TEST_MAIN(test) \ int main(int argc, char **argv) \ { \ - setenv("XDG_RUNTIME_DIR", ".", 1); \ + QTemporaryDir tmpRuntimeDir; \ + setenv("XDG_RUNTIME_DIR", tmpRuntimeDir.path().toLocal8Bit(), 1); \ setenv("XDG_CURRENT_DESKTOP", "qtwaylandtests", 1); \ setenv("QT_QPA_PLATFORM", "wayland", 1); \ test tc; \