forked from qt-creator/qt-creator
AutoTest: Fix extraction of failure location
It seems the failure location output is slightly different when using an MSVC compiler. Change-Id: I8f07debac505a0429f4ea1644d076ffcc3304f25 Reviewed-by: David Schulz <david.schulz@theqtcompany.com> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -55,6 +55,7 @@ void GTestOutputReader::processOutput()
|
|||||||
static QRegExp testSetFail(QStringLiteral("^\\[ FAILED \\] (.*) \\((.*)\\)$"));
|
static QRegExp testSetFail(QStringLiteral("^\\[ FAILED \\] (.*) \\((.*)\\)$"));
|
||||||
static QRegExp disabledTests(QStringLiteral("^ YOU HAVE (\\d+) DISABLED TESTS?$"));
|
static QRegExp disabledTests(QStringLiteral("^ YOU HAVE (\\d+) DISABLED TESTS?$"));
|
||||||
static QRegExp failureLocation(QStringLiteral("^(.*):(\\d+): Failure$"));
|
static QRegExp failureLocation(QStringLiteral("^(.*):(\\d+): Failure$"));
|
||||||
|
static QRegExp errorLocation(QStringLiteral("^(.*)\\((\\d+)\\): error:.*$"));
|
||||||
static QRegExp iterations(QStringLiteral("^Repeating all tests \\(iteration (\\d+)\\) . . .$"));
|
static QRegExp iterations(QStringLiteral("^Repeating all tests \\(iteration (\\d+)\\) . . .$"));
|
||||||
|
|
||||||
while (m_testApplication->canReadLine()) {
|
while (m_testApplication->canReadLine()) {
|
||||||
@@ -148,15 +149,21 @@ void GTestOutputReader::processOutput()
|
|||||||
testResult->setDescription(m_description);
|
testResult->setDescription(m_description);
|
||||||
|
|
||||||
foreach (const QString &output, m_description.split(QLatin1Char('\n'))) {
|
foreach (const QString &output, m_description.split(QLatin1Char('\n'))) {
|
||||||
if (failureLocation.exactMatch(output)) {
|
QRegExp *match = 0;
|
||||||
QString file = constructSourceFilePath(m_buildDir, failureLocation.cap(1));
|
if (failureLocation.exactMatch(output))
|
||||||
if (file.isEmpty())
|
match = &failureLocation;
|
||||||
continue;
|
else if (errorLocation.exactMatch(output))
|
||||||
|
match = &errorLocation;
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
QString file = constructSourceFilePath(m_buildDir, match->cap(1));
|
||||||
|
if (!file.isEmpty()) {
|
||||||
testResult->setFileName(file);
|
testResult->setFileName(file);
|
||||||
testResult->setLine(failureLocation.cap(2).toInt());
|
testResult->setLine(match->cap(2).toInt());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_futureInterface.reportResult(TestResultPtr(testResult));
|
m_futureInterface.reportResult(TestResultPtr(testResult));
|
||||||
m_description.clear();
|
m_description.clear();
|
||||||
testResult = new GTestResult(m_currentTestName);
|
testResult = new GTestResult(m_currentTestName);
|
||||||
|
|||||||
Reference in New Issue
Block a user