Some tests when failing would leave the process running.
For example on my machine tst_qqmlinspector would hang and
restarting it would not work because the before started process was
still blocking the port.
Change-Id: I32dfb4874b18d7dcf34d0f40819b17dedd794ff3
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
void tst_QDebugMessageService::init()
{
m_connection = new QQmlDebugConnection();
- m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene");
+ m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this);
m_client = new QQmlDebugMsgClient(m_connection);
m_process->start(QStringList() << QLatin1String(NORMALMODE) << QQmlDataTest::instance()->testFile(QMLFILE));
bool tst_QQmlDebugJS::init(const QString &qmlFile, bool blockMode)
{
connection = new QQmlDebugConnection();
- process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene");
+ process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this);
client = new QJSDebugClient(connection);
if (blockMode)
const QString argument = "-qmljsdebugger=port:" STR_PORT ",block";
m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath)
- + "/qmlscene");
+ + "/qmlscene", this);
m_process->start(QStringList() << argument << testFile("qtquick2.qml"));
QVERIFY2(m_process->waitForSessionStart(),
"Could not launch application, or did not get 'Waiting for connection'.");
{
const QString argument = "-qmljsdebugger=port:" STR_PORT ",block";
- m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene");
+ m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this);
m_process->start(QStringList() << argument << testFile("qtquick2.qml"));
QVERIFY2(m_process->waitForSessionStart(),
"Could not launch application, or did not get 'Waiting for connection'.");
arguments << QQmlDataTest::instance()->testFile(testFile);
- m_process = new QQmlDebugProcess(executable);
+ m_process = new QQmlDebugProcess(executable, this);
m_process->start(QStringList() << arguments);
QVERIFY2(m_process->waitForSessionStart(), "Could not launch application, or did not get 'Waiting for connection'.");
emit serverMessage(ba);
}
-QQmlDebugProcess::QQmlDebugProcess(const QString &executable)
- : m_executable(executable)
+QQmlDebugProcess::QQmlDebugProcess(const QString &executable, QObject *parent)
+ : QObject(parent)
+ , m_executable(executable)
, m_started(false)
{
m_process.setProcessChannelMode(QProcess::MergedChannels);
{
Q_OBJECT
public:
- QQmlDebugProcess(const QString &executable);
+ QQmlDebugProcess(const QString &executable, QObject *parent = 0);
~QQmlDebugProcess();
QString state();