AutoTest: Add qInfo handling

QTest can use qInfo() to print out additional information
which was ignored (with an internal warning).
Handle these messages the same way as qDebug().

Change-Id: I84106ab232580ec9066ea5fe0c03f3be8c6d0bfd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Christian Stenger
2016-07-11 10:55:43 +02:00
parent d40c4f2797
commit 26799926cb
3 changed files with 13 additions and 2 deletions

View File

@@ -65,6 +65,8 @@ Result::Type TestResult::resultFromString(const QString &resultString)
return Result::Skip;
if (resultString == QLatin1String("qdebug"))
return Result::MessageDebug;
if (resultString == QLatin1String("qinfo"))
return Result::MessageInfo;
if (resultString == QLatin1String("warn") || resultString == QLatin1String("qwarn"))
return Result::MessageWarn;
if (resultString == QLatin1String("qfatal"))
@@ -105,6 +107,8 @@ QString TestResult::resultToString(const Result::Type type)
return QLatin1String("BENCH");
case Result::MessageDebug:
return QLatin1String("DEBUG");
case Result::MessageInfo:
return QLatin1String("INFO");
case Result::MessageWarn:
return QLatin1String("WARN");
case Result::MessageFatal:
@@ -136,6 +140,7 @@ QColor TestResult::colorForType(const Result::Type type)
case Result::Skip:
return creatorTheme->color(Utils::Theme::OutputPanes_TestSkipTextColor);
case Result::MessageDebug:
case Result::MessageInfo:
return creatorTheme->color(Utils::Theme::OutputPanes_TestDebugTextColor);
case Result::MessageWarn:
return creatorTheme->color(Utils::Theme::OutputPanes_TestWarnTextColor);

View File

@@ -46,6 +46,7 @@ enum Type {
BlacklistedFail,
Benchmark,
MessageDebug,
MessageInfo,
MessageWarn,
MessageFatal,

View File

@@ -46,7 +46,7 @@ TestResultItem::~TestResultItem()
}
static QIcon testResultIcon(Result::Type result) {
static QIcon icons[11] = {
static QIcon icons[] = {
QIcon(QLatin1String(":/images/pass.png")),
QIcon(QLatin1String(":/images/fail.png")),
QIcon(QLatin1String(":/images/xfail.png")),
@@ -56,6 +56,7 @@ static QIcon testResultIcon(Result::Type result) {
QIcon(QLatin1String(":/images/blacklisted_fail.png")),
QIcon(QLatin1String(":/images/benchmark.png")),
QIcon(QLatin1String(":/images/debug.png")),
QIcon(QLatin1String(":/images/debug.png")), // Info get's the same handling as Debug for now
QIcon(QLatin1String(":/images/warn.png")),
QIcon(QLatin1String(":/images/fatal.png")),
}; // provide an icon for unknown??
@@ -298,7 +299,7 @@ void TestResultFilterModel::enableAllResultTypes()
<< Result::MessageCurrentTest << Result::MessageTestCaseStart
<< Result::MessageTestCaseSuccess << Result::MessageTestCaseWarn
<< Result::MessageTestCaseFail << Result::MessageTestCaseEnd
<< Result::MessageTestCaseRepetition;
<< Result::MessageTestCaseRepetition << Result::MessageInfo;
invalidateFilter();
}
@@ -308,10 +309,14 @@ void TestResultFilterModel::toggleTestResultType(Result::Type type)
m_enabled.remove(type);
if (type == Result::MessageInternal)
m_enabled.remove(Result::MessageTestCaseEnd);
if (type == Result::MessageDebug)
m_enabled.remove(Result::MessageInfo);
} else {
m_enabled.insert(type);
if (type == Result::MessageInternal)
m_enabled.insert(Result::MessageTestCaseEnd);
if (type == Result::MessageDebug)
m_enabled.insert(Result::MessageInfo);
}
invalidateFilter();
}