Commit d2784769 authored by Christian Stenger's avatar Christian Stenger
Browse files

Support blacklisted test cases

parent 0fc6d113
......@@ -14,6 +14,8 @@
<file>images/warn.png</file>
<file>images/xfail.png</file>
<file>images/xpass.png</file>
<file>images/blacklisted_fail.png</file>
<file>images/blacklisted_pass.png</file>
<file>images/run.png</file>
<file>images/runselected.png</file>
<file>images/stop.png</file>
......
......@@ -50,6 +50,10 @@ ResultType TestResult::resultFromString(const QString &resultString)
return MESSAGE_WARN;
if (resultString == QLatin1String("qfatal"))
return MESSAGE_FATAL;
if (resultString == QLatin1String("bpass"))
return BLACKLISTED_PASS;
if (resultString == QLatin1String("bfail"))
return BLACKLISTED_FAIL;
qDebug(" unexpected testresult...");
qDebug(resultString.toLatin1());
return UNKNOWN;
......@@ -68,6 +72,10 @@ ResultType TestResult::toResultType(int rt)
return UNEXPECTED_PASS;
case SKIP:
return SKIP;
case BLACKLISTED_PASS:
return BLACKLISTED_PASS;
case BLACKLISTED_FAIL:
return BLACKLISTED_FAIL;
case MESSAGE_DEBUG:
return MESSAGE_DEBUG;
case MESSAGE_WARN:
......@@ -102,6 +110,10 @@ QString TestResult::resultToString(const ResultType type)
return QLatin1String("FATAL");
case MESSAGE_INTERNAL:
return QString();
case BLACKLISTED_PASS:
return QLatin1String("BPASS");
case BLACKLISTED_FAIL:
return QLatin1String("BFAIL");
default:
return QLatin1String("UNKNOWN");
}
......@@ -120,6 +132,10 @@ QColor TestResult::colorForType(const ResultType type)
return QColor("#ff0000");
case SKIP:
return QColor("#787878");
case BLACKLISTED_PASS:
return QColor(0, 0, 0);
case BLACKLISTED_FAIL:
return QColor(0, 0, 0);
case MESSAGE_DEBUG:
return QColor("#329696");
case MESSAGE_WARN:
......
......@@ -31,6 +31,8 @@ enum ResultType {
EXPECTED_FAIL,
UNEXPECTED_PASS,
SKIP,
BLACKLISTED_PASS,
BLACKLISTED_FAIL,
MESSAGE_DEBUG,
MESSAGE_WARN,
MESSAGE_FATAL,
......
......@@ -91,6 +91,8 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
case ResultType::FAIL:
case ResultType::EXPECTED_FAIL:
case ResultType::UNEXPECTED_PASS:
case ResultType::BLACKLISTED_FAIL:
case ResultType::BLACKLISTED_PASS:
output = testResult.className() + QLatin1String("::") + testResult.testCase();
if (!testResult.dataTag().isEmpty())
output.append(QString::fromLatin1(" (%1)").arg(testResult.dataTag()));
......@@ -192,6 +194,8 @@ QSize TestResultDelegate::sizeHint(const QStyleOptionViewItem &option, const QMo
case ResultType::FAIL:
case ResultType::EXPECTED_FAIL:
case ResultType::UNEXPECTED_PASS:
case ResultType::BLACKLISTED_FAIL:
case ResultType::BLACKLISTED_PASS:
output = testResult.className() + QLatin1String("::") + testResult.testCase();
if (!testResult.dataTag().isEmpty())
output.append(QString::fromLatin1(" (%1)").arg(testResult.dataTag()));
......
......@@ -64,12 +64,14 @@ int TestResultModel::columnCount(const QModelIndex &parent) const
}
static QIcon testResultIcon(ResultType result) {
static QIcon icons[8] = {
static QIcon icons[10] = {
QIcon(QLatin1String(":/images/pass.png")),
QIcon(QLatin1String(":/images/fail.png")),
QIcon(QLatin1String(":/images/xfail.png")),
QIcon(QLatin1String(":/images/xpass.png")),
QIcon(QLatin1String(":/images/skip.png")),
QIcon(QLatin1String(":/images/blacklisted_pass.png")),
QIcon(QLatin1String(":/images/blacklisted_fail.png")),
QIcon(QLatin1String(":/images/debug.png")),
QIcon(QLatin1String(":/images/warn.png")),
QIcon(QLatin1String(":/images/fatal.png")),
......@@ -93,6 +95,8 @@ QVariant TestResultModel::data(const QModelIndex &index, int role) const
case ResultType::EXPECTED_FAIL:
case ResultType::UNEXPECTED_PASS:
case ResultType::SKIP:
case ResultType::BLACKLISTED_PASS:
case ResultType::BLACKLISTED_FAIL:
return QString::fromLatin1("%1::%2 (%3) - %4").arg(tr.className(), tr.testCase(),
tr.dataTag(), tr.fileName());
default:
......@@ -204,7 +208,8 @@ void TestResultFilterModel::enableAllResultTypes()
m_enabled << ResultType::PASS << ResultType::FAIL << ResultType::EXPECTED_FAIL
<< ResultType::UNEXPECTED_PASS << ResultType::SKIP << ResultType::MESSAGE_DEBUG
<< ResultType::MESSAGE_WARN << ResultType::MESSAGE_INTERNAL
<< ResultType::MESSAGE_FATAL << ResultType::UNKNOWN;
<< ResultType::MESSAGE_FATAL << ResultType::UNKNOWN << ResultType::BLACKLISTED_PASS
<< ResultType::BLACKLISTED_FAIL;
invalidateFilter();
}
......
......@@ -313,6 +313,12 @@ void TestResultsPane::updateSummaryLabel()
if (count)
labelText.append(QString::fromLatin1(", %1 %2")
.arg(QString::number(count), tr("fatals")));
count = m_model->resultTypeCount(ResultType::BLACKLISTED_FAIL)
+ m_model->resultTypeCount(ResultType::BLACKLISTED_PASS);
if (count)
labelText.append(QString::fromLatin1(", %1 %2")
.arg(QString::number(count), tr("blacklisted")));
labelText.append(QLatin1String(".</p>"));
m_summaryLabel->setText(labelText);
}
......
Supports Markdown
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