diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-01-15 08:30:54 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-01-15 08:40:23 +0100 |
commit | 71d60ee9c863c178adb8d80814f7ea912ea74101 (patch) | |
tree | 2dd0c0fee304d0660f96963a33eec690ba605ebc /src/plugins/qtsupport/qtoutputformatter.cpp | |
parent | 09c1c170d279047cbb873523b9ef9fc305e8b76d (diff) | |
parent | a111daf93ea954b86791581ea3ac53e15ea145d4 (diff) |
Merge remote-tracking branch 'origin/4.8'
Conflicts:
src/plugins/cpptools/compileroptionsbuilder.cpp
Change-Id: I522f91de70aff28692d7c3a050e8d52df0b82a76
Diffstat (limited to 'src/plugins/qtsupport/qtoutputformatter.cpp')
-rw-r--r-- | src/plugins/qtsupport/qtoutputformatter.cpp | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/src/plugins/qtsupport/qtoutputformatter.cpp b/src/plugins/qtsupport/qtoutputformatter.cpp index 04cd7ba09f..17487c9428 100644 --- a/src/plugins/qtsupport/qtoutputformatter.cpp +++ b/src/plugins/qtsupport/qtoutputformatter.cpp @@ -61,9 +61,11 @@ public: , qtError(QLatin1String("Object::.*in (.*:\\d+)")) , qtAssert(QLatin1String("ASSERT: .* in file (.+, line \\d+)")) , qtAssertX(QLatin1String("ASSERT failure in .*: \".*\", file (.+, line \\d+)")) - , qtTestFail(QLatin1String("^ Loc: \\[(.*)\\]")) + , qtTestFailUnix(QLatin1String("^ Loc: \\[(.*)\\]")) + , qtTestFailWin(QLatin1String("^(.*\\(\\d+\\)) : failure location\\s*$")) , project(proj) { + qmlError.setMinimal(true); } ~QtOutputFormatterPrivate() @@ -74,7 +76,8 @@ public: QRegExp qtError; QRegExp qtAssert; QRegExp qtAssertX; - QRegExp qtTestFail; + QRegExp qtTestFailUnix; + QRegExp qtTestFailWin; QPointer<Project> project; QString lastLine; FileInProjectFinder projectFinder; @@ -122,9 +125,13 @@ LinkResult QtOutputFormatter::matchLine(const QString &line) const lr.href = d->qtAssertX.cap(1); lr.start = d->qtAssertX.pos(1); lr.end = lr.start + lr.href.length(); - } else if (d->qtTestFail.indexIn(line) != -1) { - lr.href = d->qtTestFail.cap(1); - lr.start = d->qtTestFail.pos(1); + } else if (d->qtTestFailUnix.indexIn(line) != -1) { + lr.href = d->qtTestFailUnix.cap(1); + lr.start = d->qtTestFailUnix.pos(1); + lr.end = lr.start + lr.href.length(); + } else if (d->qtTestFailWin.indexIn(line) != -1) { + lr.href = d->qtTestFailWin.cap(1); + lr.start = d->qtTestFailWin.pos(1); lr.end = lr.start + lr.href.length(); } return lr; @@ -360,6 +367,34 @@ void QtSupportPlugin::testQtOutputFormatter_data() << QString::fromLatin1("file:///main.qml:20 Unexpected token `identifier'") << 0 << 19 << QString::fromLatin1("file:///main.qml:20") << QString::fromLatin1("/main.qml") << 20 << -1; + + QTest::newRow("Unix file link with timestamp") + << QString::fromLatin1("file:///home/user/main.cpp:157 2018-03-21 10:54:45.706") + << 0 << 30 << QString::fromLatin1("file:///home/user/main.cpp:157") + << QString::fromLatin1("/home/user/main.cpp") << 157 << -1; + + QTest::newRow("Windows file link with timestamp") + << QString::fromLatin1("file:///e:/path/main.cpp:157 2018-03-21 10:54:45.706") + << 0 << 28 << QString::fromLatin1("file:///e:/path/main.cpp:157") + << (Utils::HostOsInfo::isWindowsHost() + ? QString::fromLatin1("e:/path/main.cpp") + : QString::fromLatin1("/e:/path/main.cpp")) + << 157 << -1; + + QTest::newRow("Unix failed QTest link") + << QString::fromLatin1(" Loc: [../TestProject/test.cpp(123)]") + << 9 << 37 << QString::fromLatin1("../TestProject/test.cpp(123)") + << QString::fromLatin1("../TestProject/test.cpp") << 123 << -1; + + QTest::newRow("Windows failed QTest link") + << QString::fromLatin1("..\\TestProject\\test.cpp(123) : failure location") + << 0 << 28 << QString::fromLatin1("..\\TestProject\\test.cpp(123)") + << QString::fromLatin1("..\\TestProject\\test.cpp") << 123 << -1; + + QTest::newRow("Windows failed QTest link with carriage return") + << QString::fromLatin1("..\\TestProject\\test.cpp(123) : failure location\r") + << 0 << 28 << QString::fromLatin1("..\\TestProject\\test.cpp(123)") + << QString::fromLatin1("..\\TestProject\\test.cpp") << 123 << -1; } void QtSupportPlugin::testQtOutputFormatter() |