aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-07-12 16:55:44 +0200
committerUlf Hermann <ulf.hermann@qt.io>2018-07-12 16:13:19 +0000
commit94390dd5ae877e462c44c445de859ea93c24361f (patch)
tree3e5e432283b1560f69f731cab53c7b03643cdbdc /tests/auto
parent86dcf1580f4b8cedcd65b1b8744af876583bd9b3 (diff)
Tooling: Increase timeouts in qqmldebugjs test by a factor of 6
The CI is slow. It takes up to a minute to start a process, and therefore I'm not surprised the resulting process won't hit a break point within 5s. Let's hope 30s is enough. Change-Id: Idd5b8ad517a866ad577693e3279a4ded031d4eb6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp95
1 files changed, 51 insertions, 44 deletions
diff --git a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp
index 660afce216..a28dbcd9de 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp
+++ b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs/tst_qqmldebugjs.cpp
@@ -227,6 +227,8 @@ private:
QPointer<QJSDebugClient> m_client;
void targetData();
+ bool waitForClientSignal(const char *signal, int timeout = 30000);
+
QTime t;
};
@@ -796,7 +798,7 @@ void tst_QQmlDebugJS::connect()
QFETCH(bool, qmlscene);
QCOMPARE(init(qmlscene, QString(TEST_QMLFILE), blockMode, restrictMode), ConnectSuccess);
m_client->connect();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(connected())));
+ QVERIFY(waitForClientSignal(SIGNAL(connected())));
}
void tst_QQmlDebugJS::interrupt()
@@ -810,7 +812,7 @@ void tst_QQmlDebugJS::interrupt()
m_client->connect(redundantRefs, namesAsObjects);
m_client->interrupt();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(interruptRequested())));
+ QVERIFY(waitForClientSignal(SIGNAL(interruptRequested())));
}
void tst_QQmlDebugJS::getVersion()
@@ -822,10 +824,10 @@ void tst_QQmlDebugJS::getVersion()
QFETCH(bool, namesAsObjects);
QCOMPARE(init(qmlscene), ConnectSuccess);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(connected())));
+ QVERIFY(waitForClientSignal(SIGNAL(connected())));
m_client->version();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
}
void tst_QQmlDebugJS::getVersionWhenAttaching()
@@ -839,7 +841,7 @@ void tst_QQmlDebugJS::getVersionWhenAttaching()
m_client->connect(redundantRefs, namesAsObjects);
m_client->version();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
}
void tst_QQmlDebugJS::disconnect()
@@ -853,7 +855,7 @@ void tst_QQmlDebugJS::disconnect()
m_client->connect(redundantRefs, namesAsObjects);
m_client->disconnect();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
}
void tst_QQmlDebugJS::setBreakpointInScriptOnCompleted()
@@ -868,7 +870,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnCompleted()
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -891,7 +893,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnComponentCreated()
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -914,7 +916,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnTimerCallback()
//We can set the breakpoint after connect() here because the timer is repeating and if we miss
//its first iteration we can still catch the second one.
m_client->setBreakpoint(QLatin1String(TIMER_QMLFILE), sourceLine, -1, true);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -937,7 +939,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptInDifferentFile()
m_client->setBreakpoint(QLatin1String(TEST_JSFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -962,7 +964,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnComment()
m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
QEXPECT_FAIL("", "Relocation of breakpoints is disabled right now", Abort);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped()), 1));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped()), 1));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -987,7 +989,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnEmptyLine()
m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
QEXPECT_FAIL("", "Relocation of breakpoints is disabled right now", Abort);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped()), 1));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped()), 1));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -1010,7 +1012,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnOptimizedBinding()
m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -1033,7 +1035,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptWithCondition()
m_client->connect(redundantRefs, namesAsObjects);
//The breakpoint is in a timer loop so we can set it after connect().
m_client->setBreakpoint(QLatin1String(CONDITION_QMLFILE), sourceLine, 1, true, QLatin1String("a > 10"));
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
//Get the frame index
QString jsonString = m_client->response;
@@ -1045,7 +1047,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptWithCondition()
//Verify the value of 'result'
m_client->evaluate(QLatin1String("a"),frameIndex);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
}
jsonString = m_client->response;
@@ -1071,7 +1073,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptThatQuits()
m_client->setBreakpoint(QLatin1String(QUIT_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -1100,7 +1102,7 @@ void tst_QQmlDebugJS::setBreakpointWhenAttaching()
//The breakpoint is in a timer loop so we can set it after connect().
m_client->setBreakpoint(QLatin1String(TIMER_QMLFILE), sourceLine);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
}
void tst_QQmlDebugJS::clearBreakpoint()
@@ -1121,7 +1123,7 @@ void tst_QQmlDebugJS::clearBreakpoint()
m_client->setBreakpoint(QLatin1String(CHANGEBREAKPOINT_QMLFILE), sourceLine1, -1, true);
m_client->setBreakpoint(QLatin1String(CHANGEBREAKPOINT_QMLFILE), sourceLine2, -1, true);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
//Will hit 1st brakpoint, change this breakpoint enable = false
QString jsonString(m_client->response);
@@ -1133,17 +1135,17 @@ void tst_QQmlDebugJS::clearBreakpoint()
int breakpoint = breakpointsHit.at(0).toInt();
m_client->clearBreakpoint(breakpoint);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
//Continue with debugging
m_client->continueDebugging(QJSDebugClient::Continue);
//Hit 2nd breakpoint
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
//Continue with debugging
m_client->continueDebugging(QJSDebugClient::Continue);
//Should stop at 2nd breakpoint
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
jsonString = m_client->response;
value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -1163,7 +1165,7 @@ void tst_QQmlDebugJS::setExceptionBreak()
QCOMPARE(init(qmlscene, EXCEPTION_QMLFILE), ConnectSuccess);
m_client->setExceptionBreak(QJSDebugClient::All,true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
}
void tst_QQmlDebugJS::stepNext()
@@ -1178,10 +1180,10 @@ void tst_QQmlDebugJS::stepNext()
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->continueDebugging(QJSDebugClient::Next);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -1213,11 +1215,11 @@ void tst_QQmlDebugJS::stepIn()
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, 1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QCOMPARE(responseBody(m_client).value("sourceLine").toInt(), sourceLine);
m_client->continueDebugging(QJSDebugClient::In);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
const QVariantMap body = responseBody(m_client);
QCOMPARE(body.value("sourceLine").toInt(), actualLine);
@@ -1237,11 +1239,11 @@ void tst_QQmlDebugJS::stepOut()
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QCOMPARE(responseBody(m_client).value("sourceLine").toInt(), sourceLine);
m_client->continueDebugging(QJSDebugClient::Out);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
const QVariantMap body = responseBody(m_client);
QCOMPARE(body.value("sourceLine").toInt(), actualLine);
@@ -1262,10 +1264,10 @@ void tst_QQmlDebugJS::continueDebugging()
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine1, -1, true);
m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine2, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->continueDebugging(QJSDebugClient::Continue);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList() << QJSValue(jsonString)).toVariant().toMap();
@@ -1288,10 +1290,10 @@ void tst_QQmlDebugJS::backtrace()
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->backtrace();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
}
void tst_QQmlDebugJS::getFrameDetails()
@@ -1306,10 +1308,10 @@ void tst_QQmlDebugJS::getFrameDetails()
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->frame();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
}
void tst_QQmlDebugJS::getScopeDetails()
@@ -1324,10 +1326,10 @@ void tst_QQmlDebugJS::getScopeDetails()
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->scope();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
}
void tst_QQmlDebugJS::evaluateInGlobalScope()
@@ -1340,7 +1342,7 @@ void tst_QQmlDebugJS::evaluateInGlobalScope()
for (int i = 0; i < 10; ++i) {
// The engine might not be initialized, yet. We just try until it shows up.
m_client->evaluate(QLatin1String("console.log('Hello World')"));
- if (QQmlDebugTest::waitForSignal(m_client, SIGNAL(result()), 500))
+ if (waitForClientSignal(SIGNAL(result()), 500))
break;
}
@@ -1360,10 +1362,10 @@ void tst_QQmlDebugJS::evaluateInLocalScope()
m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->frame();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
//Get the frame index
QString jsonString(m_client->response);
@@ -1374,7 +1376,7 @@ void tst_QQmlDebugJS::evaluateInLocalScope()
int frameIndex = body.value("index").toInt();
m_client->evaluate(QLatin1String("root.a"), frameIndex);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
//Verify the value of 'timer.interval'
jsonString = m_client->response;
@@ -1405,7 +1407,7 @@ void tst_QQmlDebugJS::evaluateInContext()
// "a" not accessible without extra context
m_client->evaluate(QLatin1String("a + 10"), -1, -1);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(failure())));
+ QVERIFY(waitForClientSignal(SIGNAL(failure())));
bool success = false;
engineClient->queryAvailableEngines(&success);
@@ -1428,7 +1430,7 @@ void tst_QQmlDebugJS::evaluateInContext()
// "a" accessible in context of surrounding object
m_client->evaluate(QLatin1String("a + 10"), -1, object.debugId);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
QTRY_COMPARE(responseBody(m_client).value("value").toInt(), 20);
}
@@ -1444,10 +1446,10 @@ void tst_QQmlDebugJS::getScripts()
m_client->setBreakpoint(QString(TEST_QMLFILE), 35, -1, true);
m_client->connect(redundantRefs, namesAsObjects);
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(stopped())));
+ QVERIFY(waitForClientSignal(SIGNAL(stopped())));
m_client->scripts();
- QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(result())));
+ QVERIFY(waitForClientSignal(SIGNAL(result())));
QString jsonString(m_client->response);
QVariantMap value = m_client->parser.call(QJSValueList()
<< QJSValue(jsonString)).toVariant().toMap();
@@ -1543,6 +1545,11 @@ void tst_QQmlDebugJS::targetData()
QTest::newRow("qmlscene / sparse / strings") << true << false << false;
}
+bool tst_QQmlDebugJS::waitForClientSignal(const char *signal, int timeout)
+{
+ return QQmlDebugTest::waitForSignal(m_client.data(), signal, timeout);
+}
+
QTEST_MAIN(tst_QQmlDebugJS)
#include "tst_qqmldebugjs.moc"