forked from qt-creator/qt-creator
Fix processlauncher for tests
The socket/name for QLocalServer must be a path that is short enough for
unix sockets (<= 104 chars).
QLocalServer already ensures that the "name" is an absolute path, by
prepending QDir::tempPath() if it isn't. For Qt Creator that worked, but
the temporary directory set up for the unittests resulted in a too long
combined path.
Also, we should avoid directly using QDir::tempPath() and use
Utils::TemporaryDirectory to keep all our temporary files at one place.
So, make the "name" explicitly an absolute path in our specific
temporary directory, and make the name shorter for the test.
See 6feed6e656 for a similar issue.
Change-Id: I07dc4233db1c9d353cd6977da43850256057ba55
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include "launcherpackets.h"
|
#include "launcherpackets.h"
|
||||||
#include "launchersocket.h"
|
#include "launchersocket.h"
|
||||||
#include "qtcassert.h"
|
#include "qtcassert.h"
|
||||||
|
#include "temporarydirectory.h"
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -72,8 +73,8 @@ private:
|
|||||||
|
|
||||||
static QString launcherSocketName()
|
static QString launcherSocketName()
|
||||||
{
|
{
|
||||||
return QStringLiteral("qtcreator_processlauncher-%1")
|
return Utils::TemporaryDirectory::masterDirectoryPath()
|
||||||
.arg(QString::number(qApp->applicationPid()));
|
+ QStringLiteral("/launcher-%1").arg(QString::number(qApp->applicationPid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
class LauncherInterfacePrivate : public QObject
|
class LauncherInterfacePrivate : public QObject
|
||||||
|
|||||||
Reference in New Issue
Block a user