forked from qt-creator/qt-creator
Support blacklisted test cases
This commit is contained in:
@@ -14,6 +14,8 @@
|
|||||||
<file>images/warn.png</file>
|
<file>images/warn.png</file>
|
||||||
<file>images/xfail.png</file>
|
<file>images/xfail.png</file>
|
||||||
<file>images/xpass.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/run.png</file>
|
||||||
<file>images/runselected.png</file>
|
<file>images/runselected.png</file>
|
||||||
<file>images/stop.png</file>
|
<file>images/stop.png</file>
|
||||||
|
|||||||
BIN
plugins/autotest/images/blacklisted_fail.png
Normal file
BIN
plugins/autotest/images/blacklisted_fail.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 520 B |
BIN
plugins/autotest/images/blacklisted_pass.png
Normal file
BIN
plugins/autotest/images/blacklisted_pass.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 519 B |
@@ -50,6 +50,10 @@ ResultType TestResult::resultFromString(const QString &resultString)
|
|||||||
return MESSAGE_WARN;
|
return MESSAGE_WARN;
|
||||||
if (resultString == QLatin1String("qfatal"))
|
if (resultString == QLatin1String("qfatal"))
|
||||||
return MESSAGE_FATAL;
|
return MESSAGE_FATAL;
|
||||||
|
if (resultString == QLatin1String("bpass"))
|
||||||
|
return BLACKLISTED_PASS;
|
||||||
|
if (resultString == QLatin1String("bfail"))
|
||||||
|
return BLACKLISTED_FAIL;
|
||||||
qDebug(" unexpected testresult...");
|
qDebug(" unexpected testresult...");
|
||||||
qDebug(resultString.toLatin1());
|
qDebug(resultString.toLatin1());
|
||||||
return UNKNOWN;
|
return UNKNOWN;
|
||||||
@@ -68,6 +72,10 @@ ResultType TestResult::toResultType(int rt)
|
|||||||
return UNEXPECTED_PASS;
|
return UNEXPECTED_PASS;
|
||||||
case SKIP:
|
case SKIP:
|
||||||
return SKIP;
|
return SKIP;
|
||||||
|
case BLACKLISTED_PASS:
|
||||||
|
return BLACKLISTED_PASS;
|
||||||
|
case BLACKLISTED_FAIL:
|
||||||
|
return BLACKLISTED_FAIL;
|
||||||
case MESSAGE_DEBUG:
|
case MESSAGE_DEBUG:
|
||||||
return MESSAGE_DEBUG;
|
return MESSAGE_DEBUG;
|
||||||
case MESSAGE_WARN:
|
case MESSAGE_WARN:
|
||||||
@@ -102,6 +110,10 @@ QString TestResult::resultToString(const ResultType type)
|
|||||||
return QLatin1String("FATAL");
|
return QLatin1String("FATAL");
|
||||||
case MESSAGE_INTERNAL:
|
case MESSAGE_INTERNAL:
|
||||||
return QString();
|
return QString();
|
||||||
|
case BLACKLISTED_PASS:
|
||||||
|
return QLatin1String("BPASS");
|
||||||
|
case BLACKLISTED_FAIL:
|
||||||
|
return QLatin1String("BFAIL");
|
||||||
default:
|
default:
|
||||||
return QLatin1String("UNKNOWN");
|
return QLatin1String("UNKNOWN");
|
||||||
}
|
}
|
||||||
@@ -120,6 +132,10 @@ QColor TestResult::colorForType(const ResultType type)
|
|||||||
return QColor("#ff0000");
|
return QColor("#ff0000");
|
||||||
case SKIP:
|
case SKIP:
|
||||||
return QColor("#787878");
|
return QColor("#787878");
|
||||||
|
case BLACKLISTED_PASS:
|
||||||
|
return QColor(0, 0, 0);
|
||||||
|
case BLACKLISTED_FAIL:
|
||||||
|
return QColor(0, 0, 0);
|
||||||
case MESSAGE_DEBUG:
|
case MESSAGE_DEBUG:
|
||||||
return QColor("#329696");
|
return QColor("#329696");
|
||||||
case MESSAGE_WARN:
|
case MESSAGE_WARN:
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ enum ResultType {
|
|||||||
EXPECTED_FAIL,
|
EXPECTED_FAIL,
|
||||||
UNEXPECTED_PASS,
|
UNEXPECTED_PASS,
|
||||||
SKIP,
|
SKIP,
|
||||||
|
BLACKLISTED_PASS,
|
||||||
|
BLACKLISTED_FAIL,
|
||||||
MESSAGE_DEBUG,
|
MESSAGE_DEBUG,
|
||||||
MESSAGE_WARN,
|
MESSAGE_WARN,
|
||||||
MESSAGE_FATAL,
|
MESSAGE_FATAL,
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
|||||||
case ResultType::FAIL:
|
case ResultType::FAIL:
|
||||||
case ResultType::EXPECTED_FAIL:
|
case ResultType::EXPECTED_FAIL:
|
||||||
case ResultType::UNEXPECTED_PASS:
|
case ResultType::UNEXPECTED_PASS:
|
||||||
|
case ResultType::BLACKLISTED_FAIL:
|
||||||
|
case ResultType::BLACKLISTED_PASS:
|
||||||
output = testResult.className() + QLatin1String("::") + testResult.testCase();
|
output = testResult.className() + QLatin1String("::") + testResult.testCase();
|
||||||
if (!testResult.dataTag().isEmpty())
|
if (!testResult.dataTag().isEmpty())
|
||||||
output.append(QString::fromLatin1(" (%1)").arg(testResult.dataTag()));
|
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::FAIL:
|
||||||
case ResultType::EXPECTED_FAIL:
|
case ResultType::EXPECTED_FAIL:
|
||||||
case ResultType::UNEXPECTED_PASS:
|
case ResultType::UNEXPECTED_PASS:
|
||||||
|
case ResultType::BLACKLISTED_FAIL:
|
||||||
|
case ResultType::BLACKLISTED_PASS:
|
||||||
output = testResult.className() + QLatin1String("::") + testResult.testCase();
|
output = testResult.className() + QLatin1String("::") + testResult.testCase();
|
||||||
if (!testResult.dataTag().isEmpty())
|
if (!testResult.dataTag().isEmpty())
|
||||||
output.append(QString::fromLatin1(" (%1)").arg(testResult.dataTag()));
|
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 testResultIcon(ResultType result) {
|
||||||
static QIcon icons[8] = {
|
static QIcon icons[10] = {
|
||||||
QIcon(QLatin1String(":/images/pass.png")),
|
QIcon(QLatin1String(":/images/pass.png")),
|
||||||
QIcon(QLatin1String(":/images/fail.png")),
|
QIcon(QLatin1String(":/images/fail.png")),
|
||||||
QIcon(QLatin1String(":/images/xfail.png")),
|
QIcon(QLatin1String(":/images/xfail.png")),
|
||||||
QIcon(QLatin1String(":/images/xpass.png")),
|
QIcon(QLatin1String(":/images/xpass.png")),
|
||||||
QIcon(QLatin1String(":/images/skip.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/debug.png")),
|
||||||
QIcon(QLatin1String(":/images/warn.png")),
|
QIcon(QLatin1String(":/images/warn.png")),
|
||||||
QIcon(QLatin1String(":/images/fatal.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::EXPECTED_FAIL:
|
||||||
case ResultType::UNEXPECTED_PASS:
|
case ResultType::UNEXPECTED_PASS:
|
||||||
case ResultType::SKIP:
|
case ResultType::SKIP:
|
||||||
|
case ResultType::BLACKLISTED_PASS:
|
||||||
|
case ResultType::BLACKLISTED_FAIL:
|
||||||
return QString::fromLatin1("%1::%2 (%3) - %4").arg(tr.className(), tr.testCase(),
|
return QString::fromLatin1("%1::%2 (%3) - %4").arg(tr.className(), tr.testCase(),
|
||||||
tr.dataTag(), tr.fileName());
|
tr.dataTag(), tr.fileName());
|
||||||
default:
|
default:
|
||||||
@@ -204,7 +208,8 @@ void TestResultFilterModel::enableAllResultTypes()
|
|||||||
m_enabled << ResultType::PASS << ResultType::FAIL << ResultType::EXPECTED_FAIL
|
m_enabled << ResultType::PASS << ResultType::FAIL << ResultType::EXPECTED_FAIL
|
||||||
<< ResultType::UNEXPECTED_PASS << ResultType::SKIP << ResultType::MESSAGE_DEBUG
|
<< ResultType::UNEXPECTED_PASS << ResultType::SKIP << ResultType::MESSAGE_DEBUG
|
||||||
<< ResultType::MESSAGE_WARN << ResultType::MESSAGE_INTERNAL
|
<< ResultType::MESSAGE_WARN << ResultType::MESSAGE_INTERNAL
|
||||||
<< ResultType::MESSAGE_FATAL << ResultType::UNKNOWN;
|
<< ResultType::MESSAGE_FATAL << ResultType::UNKNOWN << ResultType::BLACKLISTED_PASS
|
||||||
|
<< ResultType::BLACKLISTED_FAIL;
|
||||||
invalidateFilter();
|
invalidateFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -313,6 +313,12 @@ void TestResultsPane::updateSummaryLabel()
|
|||||||
if (count)
|
if (count)
|
||||||
labelText.append(QString::fromLatin1(", %1 %2")
|
labelText.append(QString::fromLatin1(", %1 %2")
|
||||||
.arg(QString::number(count), tr("fatals")));
|
.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>"));
|
labelText.append(QLatin1String(".</p>"));
|
||||||
m_summaryLabel->setText(labelText);
|
m_summaryLabel->setText(labelText);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user