Fix build: Use temporary directories for tests' XDG_RUNTIME_DIR
Using XDG_RUNTIME_DIR="." does not work after qtbase 5542785, and it was a rather brittle solution anyway. Fixes: QTBUG-79185 Change-Id: Iaf9ced66709cc6cbac8a2d54efc64e1a8c528561 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
7c4b2334a3
commit
918cc075b9
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user