summaryrefslogtreecommitdiff
path: root/plugins/autotest/testresultmodel.cpp
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@theqtcompany.com>2015-05-13 16:07:31 +0200
committerChristian Stenger <christian.stenger@theqtcompany.com>2015-06-12 13:15:53 +0300
commit4605814c1d48f31fd150f32c2687596aeb3cb74e (patch)
treee5a740eac23f861482df44824dd63a628b736d93 /plugins/autotest/testresultmodel.cpp
parent9d4509540b7a67fcb4f4087708eb207164bdee5f (diff)
downloadqt-creator-4605814c1d48f31fd150f32c2687596aeb3cb74e.tar.gz
Parse Squish's XML output and put it on results pane
Change-Id: I5206a30f11b96bd0ab1a3a360b8f5e8fec0fe5f1 Reviewed-by: Riitta-Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Diffstat (limited to 'plugins/autotest/testresultmodel.cpp')
-rw-r--r--plugins/autotest/testresultmodel.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/plugins/autotest/testresultmodel.cpp b/plugins/autotest/testresultmodel.cpp
index ee10470032..03fc6fb79a 100644
--- a/plugins/autotest/testresultmodel.cpp
+++ b/plugins/autotest/testresultmodel.cpp
@@ -107,6 +107,9 @@ QVariant TestResultModel::data(const QModelIndex &index, int role) const
const TestResult &tr = m_testResults.at(index.row());
return testResultIcon(tr.result());
}
+ if (role == Result::TypeRole) {
+ return m_testResults.at(index.row()).result();
+ }
return QVariant();
}
@@ -124,7 +127,8 @@ void TestResultModel::addTestResult(const TestResult &testResult)
const QModelIndex changed = index(m_testResults.size() - 1, 0, QModelIndex());
emit dataChanged(changed, changed);
} else {
- if (!isCurrentTestMssg && position) // decrement only if at least one other item
+ // decrement only if last message was of type MESSAGE_CURRENT_TEST
+ if (!isCurrentTestMssg && lastMssg.result() == Result::MESSAGE_CURRENT_TEST)
--position;
beginInsertRows(QModelIndex(), position, position);
m_testResults.insert(position, testResult);
@@ -222,7 +226,11 @@ void TestResultFilterModel::enableAllResultTypes()
<< Result::MESSAGE_WARN << Result::MESSAGE_INTERNAL
<< Result::MESSAGE_FATAL << Result::UNKNOWN << Result::BLACKLISTED_PASS
<< Result::BLACKLISTED_FAIL << Result::BENCHMARK
- << Result::MESSAGE_CURRENT_TEST;
+ << Result::MESSAGE_CURRENT_TEST
+ << Result::SQUISH_LOG << Result::SQUISH_PASS << Result::SQUISH_FAIL
+ << Result::SQUISH_EXPECTED_FAIL << Result::SQUISH_UNEXPECTED_PASS
+ << Result::SQUISH_WARN << Result::SQUISH_ERROR << Result::SQUISH_FATAL
+ << Result::SQUISH_START << Result::SQUISH_END;
invalidateFilter();
}
@@ -233,7 +241,26 @@ void TestResultFilterModel::toggleTestResultType(Result::Type type)
} else {
m_enabled.insert(type);
}
- invalidateFilter();
+
+ switch (type) {
+ case Result::PASS:
+ toggleTestResultType(Result::SQUISH_PASS);
+ break;
+ case Result::FAIL:
+ toggleTestResultType(Result::SQUISH_FAIL);
+ break;
+ case Result::EXPECTED_FAIL:
+ toggleTestResultType(Result::SQUISH_EXPECTED_FAIL);
+ break;
+ case Result::UNEXPECTED_PASS:
+ toggleTestResultType(Result::SQUISH_UNEXPECTED_PASS);
+ break;
+ case Result::MESSAGE_WARN:
+ toggleTestResultType(Result::SQUISH_WARN);
+ break;
+ default:
+ invalidateFilter();
+ }
}
void TestResultFilterModel::clearTestResults()