diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-01-25 14:43:07 +1000 |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2012-01-25 14:43:07 +1000 |
commit | c3601a8db91bc777ea859d6a796dfab6a218675e (patch) | |
tree | d2a4f6c83bec3cddcce020966cccac72be3aa04a /tests/auto/declarative/debugger | |
parent | 35794301d188b731a7b596d92fc632fff58586c0 (diff) | |
parent | 149f6afe321ce59aebe4ce2f9dddd1881d0ac22b (diff) |
Merge branch 'master' into animation-refactorwip/animation-refactor
Conflicts:
tests/auto/declarative/declarative.pro
Change-Id: Ie339be2989fac553d351f3077869f1847367b504
Diffstat (limited to 'tests/auto/declarative/debugger')
24 files changed, 93 insertions, 37 deletions
diff --git a/tests/auto/declarative/debugger/qdebugmessageservice/data/test.qml b/tests/auto/declarative/debugger/qdebugmessageservice/data/test.qml index 7377d4584c..4a61f3291a 100644 --- a/tests/auto/declarative/debugger/qdebugmessageservice/data/test.qml +++ b/tests/auto/declarative/debugger/qdebugmessageservice/data/test.qml @@ -1,8 +1,8 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -44,8 +44,8 @@ import QtQuick 2.0 Item { width: 360 height: 360 - Timer { - interval: 100; running: true; repeat: true - onTriggered: console.log("Timer") + Component.onCompleted: { + console.log("console.log") + console.count("console.count"); } } diff --git a/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp index 62f89e9540..15fd0c597d 100644 --- a/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ b/tests/auto/declarative/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** @@ -48,7 +48,7 @@ #include <QtCore/QString> #include <QtTest/QtTest> -const char *NORMALMODE = "-qmljsdebugger=port:3777"; +const char *NORMALMODE = "-qmljsdebugger=port:3777,block"; const char *QMLFILE = "test.qml"; class QDeclarativeDebugMsgClient; @@ -59,14 +59,16 @@ class tst_QDebugMessageService : public QDeclarativeDataTest public: tst_QDebugMessageService(); + void init(bool extendedOutput); + private slots: void initTestCase(); void cleanupTestCase(); - void init(); void cleanup(); void retrieveDebugOutput(); + void retrieveDebugOutputExtended(); private: QDeclarativeDebugProcess *m_process; @@ -74,6 +76,16 @@ private: QDeclarativeDebugConnection *m_connection; }; +struct LogEntry { + LogEntry(QtMsgType _type, QString _message) + : type(_type), message(_message) {} + + QtMsgType type; + QString message; + + QString toString() const { return QString::number(type) + ": " + message; } +}; + class QDeclarativeDebugMsgClient : public QDeclarativeDebugClient { Q_OBJECT @@ -83,6 +95,8 @@ public: { } + QList<LogEntry> logBuffer; + protected: //inherited from QDeclarativeDebugClient void statusChanged(Status status); @@ -91,9 +105,6 @@ protected: signals: void enabled(); void debugOutput(); - -public: - QByteArray debugMessage; }; void QDeclarativeDebugMsgClient::statusChanged(Status status) @@ -111,8 +122,17 @@ void QDeclarativeDebugMsgClient::messageReceived(const QByteArray &data) if (command == "MESSAGE") { int type; - ds >> type >> debugMessage; + QByteArray message; + ds >> type >> message; + QVERIFY(ds.atEnd()); + + QVERIFY(type >= QtDebugMsg); + QVERIFY(type <= QtFatalMsg); + + logBuffer << LogEntry((QtMsgType)type, QString::fromUtf8(message)); emit debugOutput(); + } else { + QFAIL("Unknown message"); } } @@ -140,12 +160,14 @@ void tst_QDebugMessageService::cleanupTestCase() delete m_connection; } -void tst_QDebugMessageService::init() +void tst_QDebugMessageService::init(bool extendedOutput) { 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()); @@ -177,8 +199,42 @@ void tst_QDebugMessageService::cleanup() void tst_QDebugMessageService::retrieveDebugOutput() { - if (m_client->debugMessage.isEmpty()) + init(false); + + int maxTries = 2; + while ((m_client->logBuffer.size() < 2) + && (maxTries-- > 0)) QVERIFY(QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(debugOutput()))); + + QCOMPARE(m_client->logBuffer.size(), 2); + + QCOMPARE(m_client->logBuffer.at(0).toString(), + LogEntry(QtDebugMsg, QLatin1String("console.log")).toString()); + QCOMPARE(m_client->logBuffer.at(1).toString(), + LogEntry(QtDebugMsg, QLatin1String("console.count: 1")).toString()); +} + +void tst_QDebugMessageService::retrieveDebugOutputExtended() +{ + init(true); + + int maxTries = 2; + while ((m_client->logBuffer.size() < 2) + && (maxTries-- > 0)) + QDeclarativeDebugTest::waitForSignal(m_client, SIGNAL(debugOutput())); + + QCOMPARE(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); + + QCOMPARE(m_client->logBuffer.at(0).toString(), + LogEntry(QtDebugMsg, logMsg).toString()); + QCOMPARE(m_client->logBuffer.at(1).toString(), + LogEntry(QtDebugMsg, countMsg).toString()); } QTEST_MAIN(tst_QDebugMessageService) diff --git a/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp b/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp index 60411c8616..d8e25c4b91 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp +++ b/tests/auto/declarative/debugger/qdeclarativedebugclient/tst_qdeclarativedebugclient.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/breakpointRelocation.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/breakpointRelocation.qml index 2e2ceb75d9..13ed4b3101 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/breakpointRelocation.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/breakpointRelocation.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/changeBreakpoint.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/changeBreakpoint.qml index e86519afb4..33ab40e0b0 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/changeBreakpoint.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/changeBreakpoint.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/condition.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/condition.qml index eb0e54ff2b..2d96bfe800 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/condition.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/condition.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/createComponent.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/createComponent.qml index af95caba30..7ef751ccdf 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/createComponent.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/createComponent.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/exception.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/exception.qml index b523d6e1d0..5f8f007d86 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/exception.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/exception.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/loadjsfile.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/loadjsfile.qml index a1b44ee76d..dff3951b3a 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/loadjsfile.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/loadjsfile.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/oncompleted.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/oncompleted.qml index 5497e38642..d386fc8cad 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/oncompleted.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/oncompleted.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/stepAction.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/stepAction.qml index 6c95e47f73..fa67cfb46f 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/stepAction.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/stepAction.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.js b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.js index 88437a39da..1ba4f18405 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.js +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.js @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.qml index 9e0caa2634..150a3311c3 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/test.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/timer.qml b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/timer.qml index 7c07101fa2..da48b86088 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/data/timer.qml +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/data/timer.qml @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp index 4f1398cc52..192b475de6 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index 590cdcf14c..9f31de56e5 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/debugger/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp b/tests/auto/declarative/debugger/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp index 108814da8d..dece1f52d0 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp +++ b/tests/auto/declarative/debugger/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp b/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp index e861d830ae..83c092b8b0 100644 --- a/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp +++ b/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativeinspector/app/main.cpp b/tests/auto/declarative/debugger/qdeclarativeinspector/app/main.cpp index 03f5a284d5..e13838cf8a 100644 --- a/tests/auto/declarative/debugger/qdeclarativeinspector/app/main.cpp +++ b/tests/auto/declarative/debugger/qdeclarativeinspector/app/main.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.cpp b/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.cpp index f650d51c8f..155faab050 100644 --- a/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.cpp +++ b/tests/auto/declarative/debugger/qdeclarativeinspector/tst_qdeclarativeinspector.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp index 0cc66bcf8e..f2fcb9fb89 100644 --- a/tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp +++ b/tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp b/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp index d4bea2fa89..80a8d0ce5a 100644 --- a/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp +++ b/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/shared/debugutil.cpp b/tests/auto/declarative/debugger/shared/debugutil.cpp index e986928fa1..de04c336bb 100644 --- a/tests/auto/declarative/debugger/shared/debugutil.cpp +++ b/tests/auto/declarative/debugger/shared/debugutil.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** diff --git a/tests/auto/declarative/debugger/shared/debugutil_p.h b/tests/auto/declarative/debugger/shared/debugutil_p.h index 0884b32a07..359c088dbf 100644 --- a/tests/auto/declarative/debugger/shared/debugutil_p.h +++ b/tests/auto/declarative/debugger/shared/debugutil_p.h @@ -3,7 +3,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the test suite of the Qt Toolkit. ** |