Commit 15da517b authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Make failed test locations clickable in output

parent 9e012e7d
......@@ -44,6 +44,7 @@ QtOutputFormatter::QtOutputFormatter(Qt4Project *project)
, m_qmlError(QLatin1String("(file:///.+:\\d+:\\d+):"))
, m_qtError(QLatin1String("Object::.*in (.*:\\d+)"))
, m_qtAssert(QLatin1String("^ASSERT: .* in file (.+, line \\d+)$"))
, m_qtTestFail(QLatin1String("^ Loc: \\[(.*)\\]$"))
, m_project(project)
{
}
......@@ -65,6 +66,10 @@ LinkResult QtOutputFormatter::matchLine(const QString &line) const
lr.href = m_qtAssert.cap(1);
lr.start = m_qtAssert.pos(1);
lr.end = lr.start + lr.href.length();
} else if (m_qtTestFail.indexIn(line) != -1) {
lr.href = m_qtTestFail.cap(1);
lr.start = m_qtTestFail.pos(1);
lr.end = lr.start + lr.href.length();
}
return lr;
}
......@@ -178,6 +183,12 @@ void QtOutputFormatter::handleLink(const QString &href)
line = qtAssertLink.cap(2).toInt();
}
QRegExp qtTestFailLink(QLatin1String("^(.*)\\((\\d+)\\)$"));
if (qtTestFailLink.indexIn(href) != -1) {
fileName = qtTestFailLink.cap(1);
line = qtTestFailLink.cap(2).toInt();
}
if (!fileName.isEmpty()) {
QFileInfo fi(fileName);
if (fi.isRelative()) {
......
......@@ -62,6 +62,7 @@ private:
QRegExp m_qmlError;
QRegExp m_qtError;
QRegExp m_qtAssert;
QRegExp m_qtTestFail;
QWeakPointer<Qt4Project> m_project;
QTextCharFormat m_linkFormat;
QString m_lastLine;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment