summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@theqtcompany.com>2014-12-01 11:42:28 +0100
committerChristian Stenger <christian.stenger@theqtcompany.com>2014-12-04 13:52:16 +0100
commitd2784769567a96221ac036e90b1f3f207257cf27 (patch)
treeddc0dd758ae027bf3f7d8302770423fb16d1fa3a
parent0fc6d113d1befa33485adee3de77ad8b2ec0e985 (diff)
downloadqt-creator-d2784769567a96221ac036e90b1f3f207257cf27.tar.gz
Support blacklisted test cases
-rw-r--r--plugins/autotest/autotest.qrc2
-rw-r--r--plugins/autotest/images/blacklisted_fail.pngbin0 -> 520 bytes
-rw-r--r--plugins/autotest/images/blacklisted_pass.pngbin0 -> 519 bytes
-rw-r--r--plugins/autotest/testresult.cpp16
-rw-r--r--plugins/autotest/testresult.h2
-rw-r--r--plugins/autotest/testresultdelegate.cpp4
-rw-r--r--plugins/autotest/testresultmodel.cpp9
-rw-r--r--plugins/autotest/testresultspane.cpp6
8 files changed, 37 insertions, 2 deletions
diff --git a/plugins/autotest/autotest.qrc b/plugins/autotest/autotest.qrc
index fe59718a58..e76830ba04 100644
--- a/plugins/autotest/autotest.qrc
+++ b/plugins/autotest/autotest.qrc
@@ -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>
diff --git a/plugins/autotest/images/blacklisted_fail.png b/plugins/autotest/images/blacklisted_fail.png
new file mode 100644
index 0000000000..695e1f9246
--- /dev/null
+++ b/plugins/autotest/images/blacklisted_fail.png
Binary files differ
diff --git a/plugins/autotest/images/blacklisted_pass.png b/plugins/autotest/images/blacklisted_pass.png
new file mode 100644
index 0000000000..bac3ffb134
--- /dev/null
+++ b/plugins/autotest/images/blacklisted_pass.png
Binary files differ
diff --git a/plugins/autotest/testresult.cpp b/plugins/autotest/testresult.cpp
index a784ec9b1a..0373b72010 100644
--- a/plugins/autotest/testresult.cpp
+++ b/plugins/autotest/testresult.cpp
@@ -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:
diff --git a/plugins/autotest/testresult.h b/plugins/autotest/testresult.h
index aa0d01e4e7..f1f246ef49 100644
--- a/plugins/autotest/testresult.h
+++ b/plugins/autotest/testresult.h
@@ -31,6 +31,8 @@ enum ResultType {
EXPECTED_FAIL,
UNEXPECTED_PASS,
SKIP,
+ BLACKLISTED_PASS,
+ BLACKLISTED_FAIL,
MESSAGE_DEBUG,
MESSAGE_WARN,
MESSAGE_FATAL,
diff --git a/plugins/autotest/testresultdelegate.cpp b/plugins/autotest/testresultdelegate.cpp
index 4231278276..b3b210f11d 100644
--- a/plugins/autotest/testresultdelegate.cpp
+++ b/plugins/autotest/testresultdelegate.cpp
@@ -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()));
diff --git a/plugins/autotest/testresultmodel.cpp b/plugins/autotest/testresultmodel.cpp
index 1fe13b57e8..ab303364c4 100644
--- a/plugins/autotest/testresultmodel.cpp
+++ b/plugins/autotest/testresultmodel.cpp
@@ -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();
}
diff --git a/plugins/autotest/testresultspane.cpp b/plugins/autotest/testresultspane.cpp
index 39441d9087..45c8d4085b 100644
--- a/plugins/autotest/testresultspane.cpp
+++ b/plugins/autotest/testresultspane.cpp
@@ -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);
}