diff options
author | Giorgos Tsiapaliokas <terietor@gmail.com> | 2013-10-23 16:47:30 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-07 12:20:24 +0100 |
commit | 6e5caf0431f63a8b67b4d787ba02d8684dbaa856 (patch) | |
tree | 391ed483672d3b5a412e1e7dd992645e2012292d /tests/auto | |
parent | 9c4cba80e4849dfe3f445b711381df4b0e7dbfc3 (diff) |
Add the features of QLoggingCategory to QML's debugging methods.
It is now possible to modify the output of QML's debugging methods. Also the
prefix of "qml" makes it possible to capture the output from the QML
files using qInstallMessageHandler.
This commit depends on qtbase/4967c7106568d5df0be4d40bf793583c7c6bdb69
Change-Id: I2c7a2cb96a0b91fd3249dc2dacbab63e6ac68243
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/debugger/shared/debugutil.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index 560c9ca9f3..0bcbf3e9be 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -235,9 +235,6 @@ void QQmlDebugProcess::processAppOutput() m_eventLoop.quit(); continue; } - } else if (line.startsWith("qml:")) { - // ### Can't enable quiet mode because that also suppresses application output - continue; //We don't use these, but they aren't output from the app either } else { // set to true if there is output not coming from the debugger outputFromAppItself = true; diff --git a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp index e744cde15b..b5b4ed40a2 100644 --- a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp +++ b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp @@ -117,7 +117,7 @@ void tst_qqmlapplicationengine::application() QCOMPARE(testProcess->exitCode(), 0); QByteArray test_stdout = testProcess->readAllStandardOutput(); QByteArray test_stderr = testProcess->readAllStandardError(); - QByteArray test_stderr_target("Start: testData\nEnd\n"); + QByteArray test_stderr_target("qml: Start: testData\nqml: End\n"); #ifdef Q_OS_WIN test_stderr_target.replace('\n', QByteArray("\r\n")); #endif diff --git a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp index 43aa82e1e4..42c6578338 100644 --- a/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp +++ b/tests/auto/qml/qqmlconsole/tst_qqmlconsole.cpp @@ -42,6 +42,7 @@ #include <QDebug> #include <QQmlEngine> #include <QQmlComponent> +#include <QLoggingCategory> #include "../../shared/util.h" class tst_qqmlconsole : public QQmlDataTest @@ -65,6 +66,11 @@ void tst_qqmlconsole::logging() { QUrl testUrl = testFileUrl("logging.qml"); + QLoggingCategory loggingCategory("qml"); + QVERIFY(loggingCategory.isDebugEnabled()); + QVERIFY(loggingCategory.isWarningEnabled()); + QVERIFY(loggingCategory.isCriticalEnabled()); + QTest::ignoreMessage(QtDebugMsg, "console.debug"); QTest::ignoreMessage(QtDebugMsg, "console.log"); QTest::ignoreMessage(QtDebugMsg, "console.info"); |