diff options
Diffstat (limited to 'tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp')
-rw-r--r-- | tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp index 07e744dc58..625e038882 100644 --- a/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ b/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp @@ -59,7 +59,7 @@ class tst_QDebugMessageService : public QDeclarativeDataTest public: tst_QDebugMessageService(); - void init(bool extendedOutput); + void init(); private slots: void initTestCase(); @@ -68,7 +68,6 @@ private slots: void cleanup(); void retrieveDebugOutput(); - void retrieveDebugOutputExtended(); private: QDeclarativeDebugProcess *m_process; @@ -165,14 +164,12 @@ void tst_QDebugMessageService::cleanupTestCase() delete m_connection; } -void tst_QDebugMessageService::init(bool extendedOutput) +void tst_QDebugMessageService::init() { m_connection = new QDeclarativeDebugConnection(); m_process = new QDeclarativeDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); m_client = new QDeclarativeDebugMsgClient(m_connection); - if (extendedOutput) - m_process->setEnvironment(QProcess::systemEnvironment() << "QML_CONSOLE_EXTENDED=1"); m_process->start(QStringList() << QLatin1String(NORMALMODE) << QDeclarativeDataTest::instance()->testFile(QMLFILE)); if (!m_process->waitForSessionStart()) { QFAIL(QString("Could not launch app. Application output: \n%1").arg(m_process->output()).toAscii()); @@ -204,7 +201,7 @@ void tst_QDebugMessageService::cleanup() void tst_QDebugMessageService::retrieveDebugOutput() { - init(false); + init(); int maxTries = 2; while ((m_client->logBuffer.size() < 2) @@ -217,27 +214,6 @@ void tst_QDebugMessageService::retrieveDebugOutput() QVERIFY(m_client->logBuffer.contains(LogEntry(QtDebugMsg, QLatin1String("console.count: 1")))); } -void tst_QDebugMessageService::retrieveDebugOutputExtended() -{ - init(true); - - int maxTries = 2; - while ((m_client->logBuffer.size() < 2) - || (maxTries-- > 0)) - QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(debugOutput()), 1000); - - QVERIFY(m_client->logBuffer.size() >= 2); - - const QString path = - QUrl::fromLocalFile(QDeclarativeDataTest::instance()->testFile(QMLFILE)).toString(); - - QString logMsg = QString::fromLatin1("console.log (%1:%2)").arg(path).arg(48); - QString countMsg = QString::fromLatin1("console.count: 1 (%1:%2)").arg(path).arg(49); - - QVERIFY(m_client->logBuffer.contains(LogEntry(QtDebugMsg, logMsg))); - QVERIFY(m_client->logBuffer.contains(LogEntry(QtDebugMsg, countMsg))); -} - QTEST_MAIN(tst_QDebugMessageService) #include "tst_qdebugmessageservice.moc" |