diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-10-10 16:14:57 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-05 12:26:43 +0100 |
commit | ea90e7ec3449de7164a1acc91bd35847ec92d783 (patch) | |
tree | 5e31cbb155c891b881b891857d1e5ace828db2ad /tests/auto/qml/debugger | |
parent | c5a6bcb6cad988fec2f560a20a9c09b6cb1e9d4b (diff) |
QmlDebug: Allow tests to ignore a number of bind errors
Like this we can effectively test the port range feature of the debug
server.
Change-Id: Id0d0b47525177f0cfbb8c35a267962a82338f047
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests/auto/qml/debugger')
-rw-r--r-- | tests/auto/qml/debugger/shared/debugutil.cpp | 18 | ||||
-rw-r--r-- | tests/auto/qml/debugger/shared/debugutil_p.h | 3 |
2 files changed, 17 insertions, 4 deletions
diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index d2f1350e0b..e0c422f6ff 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -84,6 +84,8 @@ QQmlDebugProcess::QQmlDebugProcess(const QString &executable, QObject *parent) , m_executable(executable) , m_started(false) , m_port(0) + , m_maximumBindErrors(0) + , m_receivedBindErrors(0) { m_process.setProcessChannelMode(QProcess::MergedChannels); m_timer.setSingleShot(true); @@ -152,6 +154,11 @@ void QQmlDebugProcess::stop() } } +void QQmlDebugProcess::setMaximumBindErrors(int ignore) +{ + m_maximumBindErrors = ignore; +} + void QQmlDebugProcess::timeout() { qWarning() << "Timeout while waiting for QML debugging messages " @@ -222,10 +229,13 @@ void QQmlDebugProcess::processAppOutput() continue; } if (line.contains("Unable to listen")) { - qWarning() << "App was unable to bind to port!"; - m_timer.stop(); - m_eventLoop.quit(); - continue; + if (++m_receivedBindErrors >= m_maximumBindErrors) { + if (m_maximumBindErrors == 0) + qWarning() << "App was unable to bind to port!"; + m_timer.stop(); + m_eventLoop.quit(); + } + continue; } } else { // set to true if there is output not coming from the debugger diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h index 2d6cf51072..06d5eb958b 100644 --- a/tests/auto/qml/debugger/shared/debugutil_p.h +++ b/tests/auto/qml/debugger/shared/debugutil_p.h @@ -92,6 +92,7 @@ public: QString output() const; void stop(); + void setMaximumBindErrors(int numErrors); signals: void readyReadStandardOutput(); @@ -112,6 +113,8 @@ private: bool m_started; QStringList m_environment; int m_port; + int m_maximumBindErrors; + int m_receivedBindErrors; }; #endif // DEBUGUTIL_H |