Use QLatin1String::arg() directly
No need to wrap the QLatin1String in a QString() to get at arg now. Change-Id: Iac90e052b88077b9c2bd3e7eca6bc31935baa4b8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
91e8d8027d
commit
7586e1980f
@ -112,13 +112,13 @@ void QTeamCityLogger::startLogging()
|
|||||||
|
|
||||||
flowID = tcEscapedString(QString::fromUtf8(QTestResult::currentTestObjectName()));
|
flowID = tcEscapedString(QString::fromUtf8(QTestResult::currentTestObjectName()));
|
||||||
|
|
||||||
QString str = QString(QLatin1String("##teamcity[testSuiteStarted name='%1' flowId='%1']\n")).arg(flowID);
|
QString str = QLatin1String("##teamcity[testSuiteStarted name='%1' flowId='%1']\n").arg(flowID);
|
||||||
outputString(qPrintable(str));
|
outputString(qPrintable(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QTeamCityLogger::stopLogging()
|
void QTeamCityLogger::stopLogging()
|
||||||
{
|
{
|
||||||
QString str = QString(QLatin1String("##teamcity[testSuiteFinished name='%1' flowId='%1']\n")).arg(flowID);
|
QString str = QLatin1String("##teamcity[testSuiteFinished name='%1' flowId='%1']\n").arg(flowID);
|
||||||
outputString(qPrintable(str));
|
outputString(qPrintable(str));
|
||||||
|
|
||||||
QAbstractTestLogger::stopLogging();
|
QAbstractTestLogger::stopLogging();
|
||||||
@ -146,7 +146,7 @@ void QTeamCityLogger::addIncident(IncidentTypes type, const char *description,
|
|||||||
QString tmpFuncName = escapedTestFuncName();
|
QString tmpFuncName = escapedTestFuncName();
|
||||||
|
|
||||||
if (tmpFuncName != currTestFuncName) {
|
if (tmpFuncName != currTestFuncName) {
|
||||||
buf = QString(QLatin1String("##teamcity[testStarted name='%1' flowId='%2']\n")).arg(tmpFuncName, flowID);
|
buf = QLatin1String("##teamcity[testStarted name='%1' flowId='%2']\n").arg(tmpFuncName, flowID);
|
||||||
outputString(qPrintable(buf));
|
outputString(qPrintable(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,21 +157,17 @@ void QTeamCityLogger::addIncident(IncidentTypes type, const char *description,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString detailedText = QString::fromUtf8(description);
|
QString detailedText = tcEscapedString(QString::fromUtf8(description));
|
||||||
detailedText = tcEscapedString(detailedText);
|
|
||||||
|
|
||||||
// Test failed
|
// Test failed
|
||||||
if (type == Fail || type == XPass) {
|
if (type == Fail || type == XPass) {
|
||||||
QString messageText(QLatin1String("Failure!"));
|
QString messageText(QLatin1String("Failure!"));
|
||||||
|
|
||||||
if (file)
|
if (file)
|
||||||
messageText += QString(QLatin1String(" |[Loc: %1(%2)|]")).arg(QString::fromUtf8(file)).arg(line);
|
messageText += QLatin1String(" |[Loc: %1(%2)|]").arg(QString::fromUtf8(file)).arg(line);
|
||||||
|
|
||||||
buf = QString(QLatin1String("##teamcity[testFailed name='%1' message='%2' details='%3' flowId='%4']\n"))
|
buf = QLatin1String("##teamcity[testFailed name='%1' message='%2' details='%3' flowId='%4']\n")
|
||||||
.arg(tmpFuncName,
|
.arg(tmpFuncName, messageText, detailedText, flowID);
|
||||||
messageText,
|
|
||||||
detailedText,
|
|
||||||
flowID);
|
|
||||||
|
|
||||||
outputString(qPrintable(buf));
|
outputString(qPrintable(buf));
|
||||||
} else if (type == Skip) {
|
} else if (type == Skip) {
|
||||||
@ -185,7 +181,7 @@ void QTeamCityLogger::addIncident(IncidentTypes type, const char *description,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!pendingMessages.isEmpty()) {
|
if (!pendingMessages.isEmpty()) {
|
||||||
buf = QString(QLatin1String("##teamcity[testStdOut name='%1' out='%2' flowId='%3']\n"))
|
buf = QLatin1String("##teamcity[testStdOut name='%1' out='%2' flowId='%3']\n")
|
||||||
.arg(tmpFuncName, pendingMessages, flowID);
|
.arg(tmpFuncName, pendingMessages, flowID);
|
||||||
|
|
||||||
outputString(qPrintable(buf));
|
outputString(qPrintable(buf));
|
||||||
@ -193,7 +189,7 @@ void QTeamCityLogger::addIncident(IncidentTypes type, const char *description,
|
|||||||
pendingMessages.clear();
|
pendingMessages.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = QString(QLatin1String("##teamcity[testFinished name='%1' flowId='%2']\n")).arg(tmpFuncName, flowID);
|
buf = QLatin1String("##teamcity[testFinished name='%1' flowId='%2']\n").arg(tmpFuncName, flowID);
|
||||||
outputString(qPrintable(buf));
|
outputString(qPrintable(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,15 +258,13 @@ void QTeamCityLogger::addPendingMessage(const char *type, const QString &msg, co
|
|||||||
pendMessage += QLatin1String("|n");
|
pendMessage += QLatin1String("|n");
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
pendMessage += QString(QLatin1String("%1 |[Loc: %2(%3)|]: %4"))
|
pendMessage += QLatin1String("%1 |[Loc: %2(%3)|]: %4")
|
||||||
.arg(QString::fromUtf8(type), QString::fromUtf8(file))
|
.arg(QString::fromUtf8(type), QString::fromUtf8(file))
|
||||||
.arg(line)
|
.arg(line)
|
||||||
.arg(msg);
|
.arg(msg);
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
pendMessage += QLatin1String("%1: %2").arg(QString::fromUtf8(type), msg);
|
||||||
pendMessage += QString(QLatin1String("%1: %2"))
|
|
||||||
.arg(QString::fromUtf8(type), msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pendingMessages.append(pendMessage);
|
pendingMessages.append(pendMessage);
|
||||||
|
Loading…
Reference in New Issue
Block a user