AutoTest: Add error as test result type

Task-number: QTCREATORBUG-23354
Change-Id: Iaeabfc6eedf18c52dc9bdc59833e213a09458617
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2019-12-11 11:28:06 +01:00
parent 4bd26c3e4b
commit e87088f3e9
3 changed files with 10 additions and 3 deletions

View File

@@ -117,6 +117,8 @@ QString TestResult::resultToString(const ResultType type)
return QString("FATAL"); return QString("FATAL");
case ResultType::MessageSystem: case ResultType::MessageSystem:
return QString("SYSTEM"); return QString("SYSTEM");
case ResultType::MessageError:
return QString("ERROR");
case ResultType::BlacklistedPass: case ResultType::BlacklistedPass:
return QString("BPASS"); return QString("BPASS");
case ResultType::BlacklistedFail: case ResultType::BlacklistedFail:
@@ -159,6 +161,7 @@ QColor TestResult::colorForType(const ResultType type)
return creatorTheme->color(Utils::Theme::OutputPanes_TestWarnTextColor); return creatorTheme->color(Utils::Theme::OutputPanes_TestWarnTextColor);
case ResultType::MessageFatal: case ResultType::MessageFatal:
case ResultType::MessageSystem: case ResultType::MessageSystem:
case ResultType::MessageError:
return creatorTheme->color(Utils::Theme::OutputPanes_TestFatalTextColor); return creatorTheme->color(Utils::Theme::OutputPanes_TestFatalTextColor);
case ResultType::BlacklistedPass: case ResultType::BlacklistedPass:
case ResultType::BlacklistedFail: case ResultType::BlacklistedFail:

View File

@@ -55,6 +55,7 @@ enum class ResultType {
MessageWarn, MessageWarn,
MessageFatal, MessageFatal,
MessageSystem, MessageSystem,
MessageError,
// special message - get's icon (but no color/short text) from parent // special message - get's icon (but no color/short text) from parent
MessageLocation, MessageLocation,

View File

@@ -63,13 +63,14 @@ static QIcon testResultIcon(ResultType result) {
Icons::RESULT_MESSAGEWARN.icon(), Icons::RESULT_MESSAGEWARN.icon(),
Icons::RESULT_MESSAGEFATAL.icon(), Icons::RESULT_MESSAGEFATAL.icon(),
Icons::RESULT_MESSAGEFATAL.icon(), // System gets same handling as Fatal for now Icons::RESULT_MESSAGEFATAL.icon(), // System gets same handling as Fatal for now
Icons::RESULT_MESSAGEFATAL.icon(), // Error gets same handling as Fatal for now
ProjectExplorer::Icons::DESKTOP_DEVICE.icon(), // for now ProjectExplorer::Icons::DESKTOP_DEVICE.icon(), // for now
}; // provide an icon for unknown?? }; // provide an icon for unknown??
if (result < ResultType::FIRST_TYPE || result >= ResultType::MessageInternal) { if (result < ResultType::FIRST_TYPE || result >= ResultType::MessageInternal) {
switch (result) { switch (result) {
case ResultType::Application: case ResultType::Application:
return icons[15]; return icons[16];
default: default:
return QIcon(); return QIcon();
} }
@@ -443,10 +444,12 @@ void TestResultFilterModel::enableAllResultTypes(bool enabled)
<< ResultType::BlacklistedFail << ResultType::BlacklistedXFail << ResultType::BlacklistedXPass << ResultType::BlacklistedFail << ResultType::BlacklistedXFail << ResultType::BlacklistedXPass
<< ResultType::Benchmark << ResultType::Benchmark
<< ResultType::MessageCurrentTest << ResultType::TestStart << ResultType::TestEnd << ResultType::MessageCurrentTest << ResultType::TestStart << ResultType::TestEnd
<< ResultType::MessageInfo << ResultType::MessageSystem << ResultType::Application; << ResultType::MessageInfo << ResultType::MessageSystem << ResultType::Application
<< ResultType::MessageError;
} else { } else {
m_enabled.clear(); m_enabled.clear();
m_enabled << ResultType::MessageFatal << ResultType::MessageSystem; m_enabled << ResultType::MessageFatal << ResultType::MessageSystem
<< ResultType::MessageError;
} }
invalidateFilter(); invalidateFilter();
} }