forked from qt-creator/qt-creator
Use Qt style for enums
Change-Id: I10c1379dea467f10214772168f4c1ec3134a99ee Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
This commit is contained in:
@@ -389,7 +389,7 @@ static TestTreeItem *constructTestTreeItem(const QString &fileName,
|
||||
const QMap<QString, TestCodeLocationAndType> &functions,
|
||||
const QMap<QString, TestCodeLocationList> dataTags = QMap<QString, TestCodeLocationList>())
|
||||
{
|
||||
TestTreeItem *treeItem = new TestTreeItem(testCaseName, fileName, TestTreeItem::TEST_CLASS);
|
||||
TestTreeItem *treeItem = new TestTreeItem(testCaseName, fileName, TestTreeItem::TestClass);
|
||||
treeItem->setMainFile(mainFile); // used for Quick Tests only
|
||||
treeItem->setLine(line);
|
||||
treeItem->setColumn(column);
|
||||
|
@@ -104,9 +104,9 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
// do not provide this menu entry for unnamed Quick Tests as it makes no sense
|
||||
int type = index.data(TypeRole).toInt();
|
||||
const QString &unnamed = tr(Constants::UNNAMED_QUICKTESTS);
|
||||
if ((type == TestTreeItem::TEST_FUNCTION && index.parent().data().toString() != unnamed)
|
||||
|| (type == TestTreeItem::TEST_CLASS && index.data().toString() != unnamed)
|
||||
|| (type == TestTreeItem::TEST_DATATAG)) {
|
||||
if ((type == TestTreeItem::TestFunction && index.parent().data().toString() != unnamed)
|
||||
|| (type == TestTreeItem::TestClass && index.data().toString() != unnamed)
|
||||
|| (type == TestTreeItem::TestDataTag)) {
|
||||
runThisTest = new QAction(tr("Run This Test"), &menu);
|
||||
runThisTest->setEnabled(enabled);
|
||||
connect(runThisTest, &QAction::triggered,
|
||||
@@ -250,8 +250,8 @@ void TestNavigationWidget::onRunThisTestTriggered()
|
||||
return;
|
||||
|
||||
TestTreeItem *item = static_cast<TestTreeItem *>(sourceIndex.internalPointer());
|
||||
if (item->type() == TestTreeItem::TEST_CLASS || item->type() == TestTreeItem::TEST_FUNCTION
|
||||
|| item->type() == TestTreeItem::TEST_DATATAG) {
|
||||
if (item->type() == TestTreeItem::TestClass || item->type() == TestTreeItem::TestFunction
|
||||
|| item->type() == TestTreeItem::TestDataTag) {
|
||||
if (TestConfiguration *configuration = m_model->getTestConfiguration(item)) {
|
||||
TestRunner *runner = TestRunner::instance();
|
||||
runner->setSelectedTests( {configuration} );
|
||||
|
@@ -35,7 +35,7 @@ TestResult::TestResult()
|
||||
|
||||
TestResult::TestResult(const QString &className)
|
||||
: m_class(className)
|
||||
, m_result(Result::INVALID)
|
||||
, m_result(Result::Invalid)
|
||||
, m_line(0)
|
||||
{
|
||||
}
|
||||
@@ -43,33 +43,33 @@ TestResult::TestResult(const QString &className)
|
||||
Result::Type TestResult::resultFromString(const QString &resultString)
|
||||
{
|
||||
if (resultString == QLatin1String("pass"))
|
||||
return Result::PASS;
|
||||
return Result::Pass;
|
||||
if (resultString == QLatin1String("fail"))
|
||||
return Result::FAIL;
|
||||
return Result::Fail;
|
||||
if (resultString == QLatin1String("xfail"))
|
||||
return Result::EXPECTED_FAIL;
|
||||
return Result::ExpectedFail;
|
||||
if (resultString == QLatin1String("xpass"))
|
||||
return Result::UNEXPECTED_PASS;
|
||||
return Result::UnexpectedPass;
|
||||
if (resultString == QLatin1String("skip"))
|
||||
return Result::SKIP;
|
||||
return Result::Skip;
|
||||
if (resultString == QLatin1String("qdebug"))
|
||||
return Result::MESSAGE_DEBUG;
|
||||
return Result::MessageDebug;
|
||||
if (resultString == QLatin1String("warn") || resultString == QLatin1String("qwarn"))
|
||||
return Result::MESSAGE_WARN;
|
||||
return Result::MessageWarn;
|
||||
if (resultString == QLatin1String("qfatal"))
|
||||
return Result::MESSAGE_FATAL;
|
||||
return Result::MessageFatal;
|
||||
if (resultString == QLatin1String("bpass"))
|
||||
return Result::BLACKLISTED_PASS;
|
||||
return Result::BlacklistedPass;
|
||||
if (resultString == QLatin1String("bfail"))
|
||||
return Result::BLACKLISTED_FAIL;
|
||||
return Result::BlacklistedFail;
|
||||
qDebug("Unexpected test result: %s", qPrintable(resultString));
|
||||
return Result::INVALID;
|
||||
return Result::Invalid;
|
||||
}
|
||||
|
||||
Result::Type TestResult::toResultType(int rt)
|
||||
{
|
||||
if (rt < Result::FIRST_TYPE || rt > Result::LAST_TYPE)
|
||||
return Result::INVALID;
|
||||
return Result::Invalid;
|
||||
|
||||
return (Result::Type)rt;
|
||||
}
|
||||
@@ -80,27 +80,27 @@ QString TestResult::resultToString(const Result::Type type)
|
||||
return QString();
|
||||
|
||||
switch (type) {
|
||||
case Result::PASS:
|
||||
case Result::Pass:
|
||||
return QLatin1String("PASS");
|
||||
case Result::FAIL:
|
||||
case Result::Fail:
|
||||
return QLatin1String("FAIL");
|
||||
case Result::EXPECTED_FAIL:
|
||||
case Result::ExpectedFail:
|
||||
return QLatin1String("XFAIL");
|
||||
case Result::UNEXPECTED_PASS:
|
||||
case Result::UnexpectedPass:
|
||||
return QLatin1String("XPASS");
|
||||
case Result::SKIP:
|
||||
case Result::Skip:
|
||||
return QLatin1String("SKIP");
|
||||
case Result::BENCHMARK:
|
||||
case Result::Benchmark:
|
||||
return QLatin1String("BENCH");
|
||||
case Result::MESSAGE_DEBUG:
|
||||
case Result::MessageDebug:
|
||||
return QLatin1String("DEBUG");
|
||||
case Result::MESSAGE_WARN:
|
||||
case Result::MessageWarn:
|
||||
return QLatin1String("WARN");
|
||||
case Result::MESSAGE_FATAL:
|
||||
case Result::MessageFatal:
|
||||
return QLatin1String("FATAL");
|
||||
case Result::BLACKLISTED_PASS:
|
||||
case Result::BlacklistedPass:
|
||||
return QLatin1String("BPASS");
|
||||
case Result::BLACKLISTED_FAIL:
|
||||
case Result::BlacklistedFail:
|
||||
return QLatin1String("BFAIL");
|
||||
default:
|
||||
return QLatin1String("UNKNOWN");
|
||||
@@ -113,25 +113,25 @@ QColor TestResult::colorForType(const Result::Type type)
|
||||
return QColor("transparent");
|
||||
|
||||
switch (type) {
|
||||
case Result::PASS:
|
||||
case Result::Pass:
|
||||
return QColor("#009900");
|
||||
case Result::FAIL:
|
||||
case Result::Fail:
|
||||
return QColor("#a00000");
|
||||
case Result::EXPECTED_FAIL:
|
||||
case Result::ExpectedFail:
|
||||
return QColor("#00ff00");
|
||||
case Result::UNEXPECTED_PASS:
|
||||
case Result::UnexpectedPass:
|
||||
return QColor("#ff0000");
|
||||
case Result::SKIP:
|
||||
case Result::Skip:
|
||||
return QColor("#787878");
|
||||
case Result::BLACKLISTED_PASS:
|
||||
case Result::BlacklistedPass:
|
||||
return QColor(0, 0, 0);
|
||||
case Result::BLACKLISTED_FAIL:
|
||||
case Result::BlacklistedFail:
|
||||
return QColor(0, 0, 0);
|
||||
case Result::MESSAGE_DEBUG:
|
||||
case Result::MessageDebug:
|
||||
return QColor("#329696");
|
||||
case Result::MESSAGE_WARN:
|
||||
case Result::MessageWarn:
|
||||
return QColor("#d0bb00");
|
||||
case Result::MESSAGE_FATAL:
|
||||
case Result::MessageFatal:
|
||||
return QColor("#640000");
|
||||
default:
|
||||
return QColor("#000000");
|
||||
|
@@ -29,28 +29,28 @@ namespace Internal {
|
||||
|
||||
namespace Result{
|
||||
enum Type {
|
||||
PASS, FIRST_TYPE = PASS,
|
||||
FAIL,
|
||||
EXPECTED_FAIL,
|
||||
UNEXPECTED_PASS,
|
||||
SKIP,
|
||||
BLACKLISTED_PASS,
|
||||
BLACKLISTED_FAIL,
|
||||
BENCHMARK,
|
||||
MESSAGE_DEBUG,
|
||||
MESSAGE_WARN,
|
||||
MESSAGE_FATAL,
|
||||
Pass, FIRST_TYPE = Pass,
|
||||
Fail,
|
||||
ExpectedFail,
|
||||
UnexpectedPass,
|
||||
Skip,
|
||||
BlacklistedPass,
|
||||
BlacklistedFail,
|
||||
Benchmark,
|
||||
MessageDebug,
|
||||
MessageWarn,
|
||||
MessageFatal,
|
||||
|
||||
MESSAGE_INTERNAL, INTERNAL_MESSAGES_BEGIN = MESSAGE_INTERNAL,
|
||||
MESSAGE_TEST_CASE_START,
|
||||
MESSAGE_TEST_CASE_SUCCESS,
|
||||
MESSAGE_TEST_CASE_WARN,
|
||||
MESSAGE_TEST_CASE_FAIL,
|
||||
MESSAGE_TEST_CASE_END,
|
||||
MESSAGE_CURRENT_TEST, INTERNAL_MESSAGES_END = MESSAGE_CURRENT_TEST,
|
||||
MessageInternal, INTERNAL_MESSAGES_BEGIN = MessageInternal,
|
||||
MessageTestCaseStart,
|
||||
MessageTestCaseSuccess,
|
||||
MessageTestCaseWarn,
|
||||
MessageTestCaseFail,
|
||||
MessageTestCaseEnd,
|
||||
MessageCurrentTest, INTERNAL_MESSAGES_END = MessageCurrentTest,
|
||||
|
||||
INVALID,
|
||||
LAST_TYPE = INVALID
|
||||
Invalid,
|
||||
LAST_TYPE = Invalid
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -42,12 +42,12 @@ QString TestResultDelegate::outputString(const TestResult &testResult, bool sele
|
||||
const QString desc = testResult.description();
|
||||
QString output;
|
||||
switch (testResult.result()) {
|
||||
case Result::PASS:
|
||||
case Result::FAIL:
|
||||
case Result::EXPECTED_FAIL:
|
||||
case Result::UNEXPECTED_PASS:
|
||||
case Result::BLACKLISTED_FAIL:
|
||||
case Result::BLACKLISTED_PASS:
|
||||
case Result::Pass:
|
||||
case Result::Fail:
|
||||
case Result::ExpectedFail:
|
||||
case Result::UnexpectedPass:
|
||||
case Result::BlacklistedFail:
|
||||
case Result::BlacklistedPass:
|
||||
output = testResult.className() + QLatin1String("::") + testResult.testCase();
|
||||
if (!testResult.dataTag().isEmpty())
|
||||
output.append(QString::fromLatin1(" (%1)").arg(testResult.dataTag()));
|
||||
@@ -55,7 +55,7 @@ QString TestResultDelegate::outputString(const TestResult &testResult, bool sele
|
||||
output.append(QLatin1Char('\n')).append(desc);
|
||||
}
|
||||
break;
|
||||
case Result::BENCHMARK:
|
||||
case Result::Benchmark:
|
||||
output = testResult.className() + QLatin1String("::") + testResult.testCase();
|
||||
if (!testResult.dataTag().isEmpty())
|
||||
output.append(QString::fromLatin1(" (%1)").arg(testResult.dataTag()));
|
||||
|
@@ -52,14 +52,14 @@ static QIcon testResultIcon(Result::Type result) {
|
||||
QIcon(QLatin1String(":/images/fatal.png")),
|
||||
}; // provide an icon for unknown??
|
||||
|
||||
if (result < 0 || result >= Result::MESSAGE_INTERNAL) {
|
||||
if (result < 0 || result >= Result::MessageInternal) {
|
||||
switch (result) {
|
||||
case Result::MESSAGE_TEST_CASE_SUCCESS:
|
||||
return icons[Result::PASS];
|
||||
case Result::MESSAGE_TEST_CASE_FAIL:
|
||||
return icons[Result::FAIL];
|
||||
case Result::MESSAGE_TEST_CASE_WARN:
|
||||
return icons[Result::MESSAGE_WARN];
|
||||
case Result::MessageTestCaseSuccess:
|
||||
return icons[Result::Pass];
|
||||
case Result::MessageTestCaseFail:
|
||||
return icons[Result::Fail];
|
||||
case Result::MessageTestCaseWarn:
|
||||
return icons[Result::MessageWarn];
|
||||
default:
|
||||
return QIcon();
|
||||
}
|
||||
@@ -84,25 +84,25 @@ void TestResultItem::updateDescription(const QString &description)
|
||||
|
||||
void TestResultItem::updateResult()
|
||||
{
|
||||
if (m_testResult->result() != Result::MESSAGE_TEST_CASE_START)
|
||||
if (m_testResult->result() != Result::MessageTestCaseStart)
|
||||
return;
|
||||
|
||||
Result::Type newResult = Result::MESSAGE_TEST_CASE_SUCCESS;
|
||||
Result::Type newResult = Result::MessageTestCaseSuccess;
|
||||
foreach (Utils::TreeItem *child, children()) {
|
||||
const TestResult *current = static_cast<TestResultItem *>(child)->testResult();
|
||||
if (current) {
|
||||
switch (current->result()) {
|
||||
case Result::FAIL:
|
||||
case Result::MESSAGE_FATAL:
|
||||
case Result::UNEXPECTED_PASS:
|
||||
m_testResult->setResult(Result::MESSAGE_TEST_CASE_FAIL);
|
||||
case Result::Fail:
|
||||
case Result::MessageFatal:
|
||||
case Result::UnexpectedPass:
|
||||
m_testResult->setResult(Result::MessageTestCaseFail);
|
||||
return;
|
||||
case Result::EXPECTED_FAIL:
|
||||
case Result::MESSAGE_WARN:
|
||||
case Result::SKIP:
|
||||
case Result::BLACKLISTED_FAIL:
|
||||
case Result::BLACKLISTED_PASS:
|
||||
newResult = Result::MESSAGE_TEST_CASE_WARN;
|
||||
case Result::ExpectedFail:
|
||||
case Result::MessageWarn:
|
||||
case Result::Skip:
|
||||
case Result::BlacklistedFail:
|
||||
case Result::BlacklistedPass:
|
||||
newResult = Result::MessageTestCaseWarn;
|
||||
break;
|
||||
default: {}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ QVariant TestResultModel::data(const QModelIndex &idx, int role) const
|
||||
|
||||
void TestResultModel::addTestResult(TestResult *testResult, bool autoExpand)
|
||||
{
|
||||
const bool isCurrentTestMssg = testResult->result() == Result::MESSAGE_CURRENT_TEST;
|
||||
const bool isCurrentTestMssg = testResult->result() == Result::MessageCurrentTest;
|
||||
|
||||
QVector<Utils::TreeItem *> topLevelItems = rootItem()->children();
|
||||
int lastRow = topLevelItems.size() - 1;
|
||||
@@ -143,11 +143,11 @@ void TestResultModel::addTestResult(TestResult *testResult, bool autoExpand)
|
||||
int count = m_testResultCount.value(testResult->result(), 0);
|
||||
m_testResultCount.insert(testResult->result(), ++count);
|
||||
} else {
|
||||
// MESSAGE_CURRENT_TEST should always be the last top level item
|
||||
// MessageCurrentTest should always be the last top level item
|
||||
if (lastRow >= 0) {
|
||||
TestResultItem *current = static_cast<TestResultItem *>(topLevelItems.at(lastRow));
|
||||
const TestResult *result = current->testResult();
|
||||
if (result && result->result() == Result::MESSAGE_CURRENT_TEST) {
|
||||
if (result && result->result() == Result::MessageCurrentTest) {
|
||||
current->updateDescription(testResult->description());
|
||||
emit dataChanged(current->index(), current->index());
|
||||
return;
|
||||
@@ -166,18 +166,18 @@ void TestResultModel::addTestResult(TestResult *testResult, bool autoExpand)
|
||||
current->appendChild(newItem);
|
||||
if (autoExpand)
|
||||
current->expand();
|
||||
if (testResult->result() == Result::MESSAGE_TEST_CASE_END) {
|
||||
if (testResult->result() == Result::MessageTestCaseEnd) {
|
||||
current->updateResult();
|
||||
emit dataChanged(current->index(), current->index());
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
// if we have a MESSAGE_CURRENT_TEST present, add the new top level item before it
|
||||
// if we have a MessageCurrentTest present, add the new top level item before it
|
||||
if (lastRow >= 0) {
|
||||
TestResultItem *current = static_cast<TestResultItem *>(topLevelItems.at(lastRow));
|
||||
const TestResult *result = current->testResult();
|
||||
if (result && result->result() == Result::MESSAGE_CURRENT_TEST) {
|
||||
if (result && result->result() == Result::MessageCurrentTest) {
|
||||
rootItem()->insertChild(current->index().row(), newItem);
|
||||
return;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ void TestResultModel::removeCurrentTestMessage()
|
||||
QVector<Utils::TreeItem *> topLevelItems = rootItem()->children();
|
||||
for (int row = topLevelItems.size() - 1; row >= 0; --row) {
|
||||
TestResultItem *current = static_cast<TestResultItem *>(topLevelItems.at(row));
|
||||
if (current->testResult()->result() == Result::MESSAGE_CURRENT_TEST) {
|
||||
if (current->testResult()->result() == Result::MessageCurrentTest) {
|
||||
delete takeItem(current);
|
||||
break;
|
||||
}
|
||||
@@ -272,14 +272,14 @@ TestResultFilterModel::TestResultFilterModel(TestResultModel *sourceModel, QObje
|
||||
|
||||
void TestResultFilterModel::enableAllResultTypes()
|
||||
{
|
||||
m_enabled << Result::PASS << Result::FAIL << Result::EXPECTED_FAIL
|
||||
<< Result::UNEXPECTED_PASS << Result::SKIP << Result::MESSAGE_DEBUG
|
||||
<< Result::MESSAGE_WARN << Result::MESSAGE_INTERNAL
|
||||
<< Result::MESSAGE_FATAL << Result::INVALID << Result::BLACKLISTED_PASS
|
||||
<< Result::BLACKLISTED_FAIL << Result::BENCHMARK
|
||||
<< Result::MESSAGE_CURRENT_TEST << Result::MESSAGE_TEST_CASE_START
|
||||
<< Result::MESSAGE_TEST_CASE_SUCCESS << Result::MESSAGE_TEST_CASE_WARN
|
||||
<< Result::MESSAGE_TEST_CASE_FAIL << Result::MESSAGE_TEST_CASE_END;
|
||||
m_enabled << Result::Pass << Result::Fail << Result::ExpectedFail
|
||||
<< Result::UnexpectedPass << Result::Skip << Result::MessageDebug
|
||||
<< Result::MessageWarn << Result::MessageInternal
|
||||
<< Result::MessageFatal << Result::Invalid << Result::BlacklistedPass
|
||||
<< Result::BlacklistedFail << Result::Benchmark
|
||||
<< Result::MessageCurrentTest << Result::MessageTestCaseStart
|
||||
<< Result::MessageTestCaseSuccess << Result::MessageTestCaseWarn
|
||||
<< Result::MessageTestCaseFail << Result::MessageTestCaseEnd;
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
@@ -287,12 +287,12 @@ void TestResultFilterModel::toggleTestResultType(Result::Type type)
|
||||
{
|
||||
if (m_enabled.contains(type)) {
|
||||
m_enabled.remove(type);
|
||||
if (type == Result::MESSAGE_INTERNAL)
|
||||
m_enabled.remove(Result::MESSAGE_TEST_CASE_END);
|
||||
if (type == Result::MessageInternal)
|
||||
m_enabled.remove(Result::MessageTestCaseEnd);
|
||||
} else {
|
||||
m_enabled.insert(type);
|
||||
if (type == Result::MESSAGE_INTERNAL)
|
||||
m_enabled.insert(Result::MESSAGE_TEST_CASE_END);
|
||||
if (type == Result::MessageInternal)
|
||||
m_enabled.insert(Result::MessageTestCaseEnd);
|
||||
}
|
||||
invalidateFilter();
|
||||
}
|
||||
|
@@ -394,23 +394,23 @@ void TestResultsPane::initializeFilterMenu()
|
||||
const bool omitIntern = AutotestPlugin::instance()->settings()->omitInternalMssg;
|
||||
// FilterModel has all messages enabled by default
|
||||
if (omitIntern)
|
||||
m_filterModel->toggleTestResultType(Result::MESSAGE_INTERNAL);
|
||||
m_filterModel->toggleTestResultType(Result::MessageInternal);
|
||||
|
||||
QMap<Result::Type, QString> textAndType;
|
||||
textAndType.insert(Result::PASS, tr("Pass"));
|
||||
textAndType.insert(Result::FAIL, tr("Fail"));
|
||||
textAndType.insert(Result::EXPECTED_FAIL, tr("Expected Fail"));
|
||||
textAndType.insert(Result::UNEXPECTED_PASS, tr("Unexpected Pass"));
|
||||
textAndType.insert(Result::SKIP, tr("Skip"));
|
||||
textAndType.insert(Result::BENCHMARK, tr("Benchmarks"));
|
||||
textAndType.insert(Result::MESSAGE_DEBUG, tr("Debug Messages"));
|
||||
textAndType.insert(Result::MESSAGE_WARN, tr("Warning Messages"));
|
||||
textAndType.insert(Result::MESSAGE_INTERNAL, tr("Internal Messages"));
|
||||
textAndType.insert(Result::Pass, tr("Pass"));
|
||||
textAndType.insert(Result::Fail, tr("Fail"));
|
||||
textAndType.insert(Result::ExpectedFail, tr("Expected Fail"));
|
||||
textAndType.insert(Result::UnexpectedPass, tr("Unexpected Pass"));
|
||||
textAndType.insert(Result::Skip, tr("Skip"));
|
||||
textAndType.insert(Result::Benchmark, tr("Benchmarks"));
|
||||
textAndType.insert(Result::MessageDebug, tr("Debug Messages"));
|
||||
textAndType.insert(Result::MessageWarn, tr("Warning Messages"));
|
||||
textAndType.insert(Result::MessageInternal, tr("Internal Messages"));
|
||||
foreach (Result::Type result, textAndType.keys()) {
|
||||
QAction *action = new QAction(m_filterMenu);
|
||||
action->setText(textAndType.value(result));
|
||||
action->setCheckable(true);
|
||||
action->setChecked(result != Result::MESSAGE_INTERNAL || !omitIntern);
|
||||
action->setChecked(result != Result::MessageInternal || !omitIntern);
|
||||
action->setData(result);
|
||||
m_filterMenu->addAction(action);
|
||||
}
|
||||
@@ -425,22 +425,22 @@ void TestResultsPane::initializeFilterMenu()
|
||||
void TestResultsPane::updateSummaryLabel()
|
||||
{
|
||||
QString labelText = QString::fromLatin1("<p><b>Test summary:</b> %1 %2, %3 %4")
|
||||
.arg(QString::number(m_model->resultTypeCount(Result::PASS)), tr("passes"),
|
||||
QString::number(m_model->resultTypeCount(Result::FAIL)), tr("fails"));
|
||||
int count = m_model->resultTypeCount(Result::UNEXPECTED_PASS);
|
||||
.arg(QString::number(m_model->resultTypeCount(Result::Pass)), tr("passes"),
|
||||
QString::number(m_model->resultTypeCount(Result::Fail)), tr("fails"));
|
||||
int count = m_model->resultTypeCount(Result::UnexpectedPass);
|
||||
if (count)
|
||||
labelText.append(QString::fromLatin1(", %1 %2")
|
||||
.arg(QString::number(count), tr("unexpected passes")));
|
||||
count = m_model->resultTypeCount(Result::EXPECTED_FAIL);
|
||||
count = m_model->resultTypeCount(Result::ExpectedFail);
|
||||
if (count)
|
||||
labelText.append(QString::fromLatin1(", %1 %2")
|
||||
.arg(QString::number(count), tr("expected fails")));
|
||||
count = m_model->resultTypeCount(Result::MESSAGE_FATAL);
|
||||
count = m_model->resultTypeCount(Result::MessageFatal);
|
||||
if (count)
|
||||
labelText.append(QString::fromLatin1(", %1 %2")
|
||||
.arg(QString::number(count), tr("fatals")));
|
||||
count = m_model->resultTypeCount(Result::BLACKLISTED_FAIL)
|
||||
+ m_model->resultTypeCount(Result::BLACKLISTED_PASS);
|
||||
count = m_model->resultTypeCount(Result::BlacklistedFail)
|
||||
+ m_model->resultTypeCount(Result::BlacklistedPass);
|
||||
if (count)
|
||||
labelText.append(QString::fromLatin1(", %1 %2")
|
||||
.arg(QString::number(count), tr("blacklisted")));
|
||||
|
@@ -114,7 +114,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
|
||||
if (config->project()) {
|
||||
testCaseCount += config->testCaseCount();
|
||||
} else {
|
||||
emitTestResultCreated(new FaultyTestResult(Result::MESSAGE_WARN,
|
||||
emitTestResultCreated(new FaultyTestResult(Result::MessageWarn,
|
||||
QObject::tr("Project is null for \"%1\". Removing from test run.\n"
|
||||
"Check the test environment.").arg(config->displayName())));
|
||||
}
|
||||
@@ -148,7 +148,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
|
||||
QProcessEnvironment environment = testConfiguration->environment().toProcessEnvironment();
|
||||
QString commandFilePath = executableFilePath(testConfiguration->targetFile(), environment);
|
||||
if (commandFilePath.isEmpty()) {
|
||||
emitTestResultCreated(new FaultyTestResult(Result::MESSAGE_FATAL,
|
||||
emitTestResultCreated(new FaultyTestResult(Result::MessageFatal,
|
||||
QObject::tr("Could not find command \"%1\". (%2)")
|
||||
.arg(testConfiguration->targetFile())
|
||||
.arg(testConfiguration->displayName())));
|
||||
@@ -177,7 +177,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
|
||||
if (futureInterface.isCanceled()) {
|
||||
testProcess.kill();
|
||||
testProcess.waitForFinished();
|
||||
emitTestResultCreated(new FaultyTestResult(Result::MESSAGE_FATAL,
|
||||
emitTestResultCreated(new FaultyTestResult(Result::MessageFatal,
|
||||
QObject::tr("Test run canceled by user.")));
|
||||
}
|
||||
qApp->processEvents();
|
||||
@@ -188,7 +188,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
|
||||
if (testProcess.state() != QProcess::NotRunning) {
|
||||
testProcess.kill();
|
||||
testProcess.waitForFinished();
|
||||
emitTestResultCreated(new FaultyTestResult(Result::MESSAGE_FATAL, QObject::tr(
|
||||
emitTestResultCreated(new FaultyTestResult(Result::MessageFatal, QObject::tr(
|
||||
"Test case canceled due to timeout. \nMaybe raise the timeout?")));
|
||||
}
|
||||
}
|
||||
@@ -208,14 +208,14 @@ void TestRunner::prepareToRunTests()
|
||||
|
||||
foreach (TestConfiguration *config, m_selectedTests) {
|
||||
if (!omitRunConfigWarnings && config->guessedConfiguration()) {
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_WARN,
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageWarn,
|
||||
tr("Project's run configuration was guessed for \"%1\".\n"
|
||||
"This might cause trouble during execution.").arg(config->displayName())));
|
||||
}
|
||||
}
|
||||
|
||||
if (m_selectedTests.empty()) {
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_WARN,
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageWarn,
|
||||
tr("No tests selected. Canceling test run.")));
|
||||
onFinished();
|
||||
return;
|
||||
@@ -223,7 +223,7 @@ void TestRunner::prepareToRunTests()
|
||||
|
||||
ProjectExplorer::Project *project = m_selectedTests.at(0)->project();
|
||||
if (!project) {
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_WARN,
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageWarn,
|
||||
tr("Project is null. Canceling test run.\n"
|
||||
"Only desktop kits are supported. Make sure the "
|
||||
"currently active kit is a desktop kit.")));
|
||||
@@ -239,7 +239,7 @@ void TestRunner::prepareToRunTests()
|
||||
if (project->hasActiveBuildSettings()) {
|
||||
buildProject(project);
|
||||
} else {
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_FATAL,
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageFatal,
|
||||
tr("Project is not configured. Canceling test run.")));
|
||||
onFinished();
|
||||
return;
|
||||
@@ -284,7 +284,7 @@ void TestRunner::buildFinished(bool success)
|
||||
if (success) {
|
||||
runTests();
|
||||
} else {
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_FATAL,
|
||||
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageFatal,
|
||||
tr("Build failed. Canceling test run.")));
|
||||
onFinished();
|
||||
}
|
||||
|
@@ -37,8 +37,8 @@ TestTreeItem::TestTreeItem(const QString &name, const QString &filePath, Type ty
|
||||
m_line(0)
|
||||
{
|
||||
switch (m_type) {
|
||||
case TEST_CLASS:
|
||||
case TEST_FUNCTION:
|
||||
case TestClass:
|
||||
case TestFunction:
|
||||
m_checked = Qt::Checked;
|
||||
break;
|
||||
default:
|
||||
@@ -82,14 +82,14 @@ QVariant TestTreeItem::data(int /*column*/, int role) const
|
||||
{
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
if (m_type == ROOT && childCount() == 0)
|
||||
if (m_type == Root && childCount() == 0)
|
||||
return QString(m_name + QObject::tr(" (none)"));
|
||||
else if (m_name.isEmpty())
|
||||
return QObject::tr(Constants::UNNAMED_QUICKTESTS);
|
||||
else
|
||||
return m_name;
|
||||
case Qt::ToolTipRole:
|
||||
if (m_type == TEST_CLASS && m_name.isEmpty()) {
|
||||
if (m_type == TestClass && m_name.isEmpty()) {
|
||||
return QObject::tr("<p>Give all test cases a name to ensure correct behavior "
|
||||
"when running test cases and to be able to select them.</p>");
|
||||
}
|
||||
@@ -98,14 +98,14 @@ QVariant TestTreeItem::data(int /*column*/, int role) const
|
||||
return testTreeIcon(m_type);
|
||||
case Qt::CheckStateRole:
|
||||
switch (m_type) {
|
||||
case ROOT:
|
||||
case TEST_DATAFUNCTION:
|
||||
case TEST_SPECIALFUNCTION:
|
||||
case TEST_DATATAG:
|
||||
case Root:
|
||||
case TestDataFunction:
|
||||
case TestSpecialFunction:
|
||||
case TestDataTag:
|
||||
return QVariant();
|
||||
case TEST_CLASS:
|
||||
case TestClass:
|
||||
return m_name.isEmpty() ? QVariant() : checked();
|
||||
case TEST_FUNCTION:
|
||||
case TestFunction:
|
||||
if (parentItem() && parentItem()->name().isEmpty())
|
||||
return QVariant();
|
||||
return checked();
|
||||
@@ -119,12 +119,12 @@ QVariant TestTreeItem::data(int /*column*/, int role) const
|
||||
}
|
||||
case ItalicRole:
|
||||
switch (m_type) {
|
||||
case TEST_DATAFUNCTION:
|
||||
case TEST_SPECIALFUNCTION:
|
||||
case TestDataFunction:
|
||||
case TestSpecialFunction:
|
||||
return true;
|
||||
case TEST_CLASS:
|
||||
case TestClass:
|
||||
return m_name.isEmpty();
|
||||
case TEST_FUNCTION:
|
||||
case TestFunction:
|
||||
return parentItem() ? parentItem()->name().isEmpty() : false;
|
||||
default:
|
||||
return false;
|
||||
@@ -174,12 +174,12 @@ bool TestTreeItem::modifyContent(const TestTreeItem *modified)
|
||||
void TestTreeItem::setChecked(const Qt::CheckState checkState)
|
||||
{
|
||||
switch (m_type) {
|
||||
case TEST_FUNCTION: {
|
||||
case TestFunction: {
|
||||
m_checked = (checkState == Qt::Unchecked ? Qt::Unchecked : Qt::Checked);
|
||||
parentItem()->revalidateCheckState();
|
||||
break;
|
||||
}
|
||||
case TEST_CLASS: {
|
||||
case TestClass: {
|
||||
Qt::CheckState usedState = (checkState == Qt::Unchecked ? Qt::Unchecked : Qt::Checked);
|
||||
for (int row = 0, count = childCount(); row < count; ++row)
|
||||
childItem(row)->setChecked(usedState);
|
||||
@@ -193,11 +193,11 @@ void TestTreeItem::setChecked(const Qt::CheckState checkState)
|
||||
Qt::CheckState TestTreeItem::checked() const
|
||||
{
|
||||
switch (m_type) {
|
||||
case TEST_CLASS:
|
||||
case TEST_FUNCTION:
|
||||
case TestClass:
|
||||
case TestFunction:
|
||||
return m_checked;
|
||||
case TEST_DATAFUNCTION:
|
||||
case TEST_SPECIALFUNCTION:
|
||||
case TestDataFunction:
|
||||
case TestSpecialFunction:
|
||||
return Qt::Unchecked;
|
||||
default:
|
||||
if (parent())
|
||||
@@ -233,8 +233,8 @@ void TestTreeItem::revalidateCheckState()
|
||||
for (int row = 0, count = childCount(); row < count; ++row) {
|
||||
TestTreeItem *child = childItem(row);
|
||||
switch (child->type()) {
|
||||
case TEST_DATAFUNCTION:
|
||||
case TEST_SPECIALFUNCTION:
|
||||
case TestDataFunction:
|
||||
case TestSpecialFunction:
|
||||
continue;
|
||||
default:
|
||||
break;
|
||||
|
@@ -42,16 +42,16 @@ class TestTreeItem : public Utils::TreeItem
|
||||
|
||||
public:
|
||||
enum Type {
|
||||
ROOT,
|
||||
TEST_CLASS,
|
||||
TEST_FUNCTION,
|
||||
TEST_DATATAG,
|
||||
TEST_DATAFUNCTION,
|
||||
TEST_SPECIALFUNCTION
|
||||
Root,
|
||||
TestClass,
|
||||
TestFunction,
|
||||
TestDataTag,
|
||||
TestDataFunction,
|
||||
TestSpecialFunction
|
||||
};
|
||||
|
||||
TestTreeItem(const QString &name = QString(), const QString &filePath = QString(),
|
||||
Type type = ROOT);
|
||||
Type type = Root);
|
||||
virtual ~TestTreeItem();
|
||||
TestTreeItem(const TestTreeItem& other);
|
||||
|
||||
|
@@ -38,8 +38,8 @@ namespace Internal {
|
||||
|
||||
TestTreeModel::TestTreeModel(QObject *parent) :
|
||||
TreeModel(parent),
|
||||
m_autoTestRootItem(new TestTreeItem(tr("Auto Tests"), QString(), TestTreeItem::ROOT)),
|
||||
m_quickTestRootItem(new TestTreeItem(tr("Qt Quick Tests"), QString(), TestTreeItem::ROOT)),
|
||||
m_autoTestRootItem(new TestTreeItem(tr("Auto Tests"), QString(), TestTreeItem::Root)),
|
||||
m_quickTestRootItem(new TestTreeItem(tr("Qt Quick Tests"), QString(), TestTreeItem::Root)),
|
||||
m_parser(new TestCodeParser(this)),
|
||||
m_connectionsInitialized(false)
|
||||
{
|
||||
@@ -134,11 +134,11 @@ bool TestTreeModel::setData(const QModelIndex &index, const QVariant &value, int
|
||||
emit dataChanged(index, index);
|
||||
if (role == Qt::CheckStateRole) {
|
||||
switch (item->type()) {
|
||||
case TestTreeItem::TEST_CLASS:
|
||||
case TestTreeItem::TestClass:
|
||||
if (item->childCount() > 0)
|
||||
emit dataChanged(index.child(0, 0), index.child(item->childCount() - 1, 0));
|
||||
break;
|
||||
case TestTreeItem::TEST_FUNCTION:
|
||||
case TestTreeItem::TestFunction:
|
||||
emit dataChanged(index.parent(), index.parent());
|
||||
break;
|
||||
default: // avoid warning regarding unhandled enum member
|
||||
@@ -157,19 +157,19 @@ Qt::ItemFlags TestTreeModel::flags(const QModelIndex &index) const
|
||||
|
||||
TestTreeItem *item = static_cast<TestTreeItem *>(itemForIndex(index));
|
||||
switch(item->type()) {
|
||||
case TestTreeItem::TEST_CLASS:
|
||||
case TestTreeItem::TestClass:
|
||||
if (item->name().isEmpty())
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsTristate | Qt::ItemIsUserCheckable;
|
||||
case TestTreeItem::TEST_FUNCTION:
|
||||
case TestTreeItem::TestFunction:
|
||||
if (item->parentItem()->name().isEmpty())
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
|
||||
case TestTreeItem::ROOT:
|
||||
case TestTreeItem::Root:
|
||||
return Qt::ItemIsEnabled;
|
||||
case TestTreeItem::TEST_DATAFUNCTION:
|
||||
case TestTreeItem::TEST_SPECIALFUNCTION:
|
||||
case TestTreeItem::TEST_DATATAG:
|
||||
case TestTreeItem::TestDataFunction:
|
||||
case TestTreeItem::TestSpecialFunction:
|
||||
case TestTreeItem::TestDataTag:
|
||||
default:
|
||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
|
||||
int grandChildCount = child->childCount();
|
||||
for (int grandChildRow = 0; grandChildRow < grandChildCount; ++grandChildRow) {
|
||||
const TestTreeItem *grandChild = child->childItem(grandChildRow);
|
||||
if (grandChild->type() != TestTreeItem::TEST_FUNCTION)
|
||||
if (grandChild->type() != TestTreeItem::TestFunction)
|
||||
continue;
|
||||
testFunctions << child->name() + QLatin1String("::") + grandChild->name();
|
||||
}
|
||||
@@ -355,7 +355,7 @@ TestConfiguration *TestTreeModel::getTestConfiguration(const TestTreeItem *item)
|
||||
|
||||
TestConfiguration *config = 0;
|
||||
switch (item->type()) {
|
||||
case TestTreeItem::TEST_CLASS: {
|
||||
case TestTreeItem::TestClass: {
|
||||
if (item->parent() == m_quickTestRootItem) {
|
||||
// Quick Test TestCase
|
||||
QStringList testFunctions;
|
||||
@@ -374,7 +374,7 @@ TestConfiguration *TestTreeModel::getTestConfiguration(const TestTreeItem *item)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TestTreeItem::TEST_FUNCTION: {
|
||||
case TestTreeItem::TestFunction: {
|
||||
const TestTreeItem *parent = item->parentItem();
|
||||
if (parent->parent() == m_quickTestRootItem) {
|
||||
// it's a Quick Test function of a named TestCase
|
||||
@@ -390,7 +390,7 @@ TestConfiguration *TestTreeModel::getTestConfiguration(const TestTreeItem *item)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TestTreeItem::TEST_DATATAG: {
|
||||
case TestTreeItem::TestDataTag: {
|
||||
const TestTreeItem *function = item->parentItem();
|
||||
const TestTreeItem *parent = function ? function->parentItem() : 0;
|
||||
if (!parent)
|
||||
@@ -489,7 +489,7 @@ void TestTreeModel::updateUnnamedQuickTest(const QString &mainFile,
|
||||
return;
|
||||
|
||||
if (!hasUnnamedQuickTests())
|
||||
addTestTreeItem(new TestTreeItem(QString(), QString(), TestTreeItem::TEST_CLASS), QuickTest);
|
||||
addTestTreeItem(new TestTreeItem(QString(), QString(), TestTreeItem::TestClass), QuickTest);
|
||||
|
||||
TestTreeItem *unnamed = unnamedQuickTests();
|
||||
foreach (const QString &functionName, functions.keys()) {
|
||||
@@ -730,7 +730,7 @@ bool TestTreeSortFilterModel::lessThan(const QModelIndex &left, const QModelInde
|
||||
{
|
||||
// root items keep the intended order: 1st Auto Tests, 2nd Quick Tests
|
||||
const TestTreeItem *leftItem = static_cast<TestTreeItem *>(left.internalPointer());
|
||||
if (leftItem->type() == TestTreeItem::ROOT)
|
||||
if (leftItem->type() == TestTreeItem::Root)
|
||||
return left.row() > right.row();
|
||||
|
||||
const QString leftVal = m_sourceModel->data(left, Qt::DisplayRole).toString();
|
||||
@@ -775,9 +775,9 @@ bool TestTreeSortFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex
|
||||
const TestTreeItem *item = static_cast<TestTreeItem *>(index.internalPointer());
|
||||
|
||||
switch (item->type()) {
|
||||
case TestTreeItem::TEST_DATAFUNCTION:
|
||||
case TestTreeItem::TestDataFunction:
|
||||
return m_filterMode & ShowTestData;
|
||||
case TestTreeItem::TEST_SPECIALFUNCTION:
|
||||
case TestTreeItem::TestSpecialFunction:
|
||||
return m_filterMode & ShowInitAndCleanup;
|
||||
default:
|
||||
return true;
|
||||
|
@@ -83,11 +83,11 @@ bool TestVisitor::visit(CPlusPlus::Class *symbol)
|
||||
locationAndType.m_column = member->column() - 1;
|
||||
}
|
||||
if (specialFunctions.contains(name))
|
||||
locationAndType.m_type = TestTreeItem::TEST_SPECIALFUNCTION;
|
||||
locationAndType.m_type = TestTreeItem::TestSpecialFunction;
|
||||
else if (name.endsWith(QLatin1String("_data")))
|
||||
locationAndType.m_type = TestTreeItem::TEST_DATAFUNCTION;
|
||||
locationAndType.m_type = TestTreeItem::TestDataFunction;
|
||||
else
|
||||
locationAndType.m_type = TestTreeItem::TEST_FUNCTION;
|
||||
locationAndType.m_type = TestTreeItem::TestFunction;
|
||||
m_privSlots.insert(name, locationAndType);
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ bool TestDataFunctionVisitor::visit(CPlusPlus::CallAST *ast)
|
||||
locationAndType.m_name = QString::fromUtf8(token.spell());
|
||||
locationAndType.m_column = column - 1;
|
||||
locationAndType.m_line = line;
|
||||
locationAndType.m_type = TestTreeItem::TEST_DATATAG;
|
||||
locationAndType.m_type = TestTreeItem::TestDataTag;
|
||||
m_currentTags.append(locationAndType);
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,7 @@ bool TestQmlVisitor::visit(QmlJS::AST::UiObjectDefinition *ast)
|
||||
m_testCaseLocation.m_name = m_currentDoc->fileName();
|
||||
m_testCaseLocation.m_line = sourceLocation.startLine;
|
||||
m_testCaseLocation.m_column = sourceLocation.startColumn - 1;
|
||||
m_testCaseLocation.m_type = TestTreeItem::TEST_CLASS;
|
||||
m_testCaseLocation.m_type = TestTreeItem::TestClass;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -322,11 +322,11 @@ bool TestQmlVisitor::visit(QmlJS::AST::FunctionDeclaration *ast)
|
||||
locationAndType.m_line = sourceLocation.startLine;
|
||||
locationAndType.m_column = sourceLocation.startColumn - 1;
|
||||
if (specialFunctions.contains(name.toString()))
|
||||
locationAndType.m_type = TestTreeItem::TEST_SPECIALFUNCTION;
|
||||
locationAndType.m_type = TestTreeItem::TestSpecialFunction;
|
||||
else if (name.endsWith(QLatin1String("_data")))
|
||||
locationAndType.m_type = TestTreeItem::TEST_DATAFUNCTION;
|
||||
locationAndType.m_type = TestTreeItem::TestDataFunction;
|
||||
else
|
||||
locationAndType.m_type = TestTreeItem::TEST_FUNCTION;
|
||||
locationAndType.m_type = TestTreeItem::TestFunction;
|
||||
|
||||
m_testFunctions.insert(name.toString(), locationAndType);
|
||||
}
|
||||
|
@@ -160,7 +160,7 @@ void TestXmlOutputReader::processOutput()
|
||||
static QString className;
|
||||
static QString testCase;
|
||||
static QString dataTag;
|
||||
static Result::Type result = Result::INVALID;
|
||||
static Result::Type result = Result::Invalid;
|
||||
static QString description;
|
||||
static QString file;
|
||||
static int lineNumber = 0;
|
||||
@@ -184,14 +184,14 @@ void TestXmlOutputReader::processOutput()
|
||||
className = xmlReader.attributes().value(QStringLiteral("name")).toString();
|
||||
QTC_ASSERT(!className.isEmpty(), continue);
|
||||
auto testResult = new TestResult(className);
|
||||
testResult->setResult(Result::MESSAGE_TEST_CASE_START);
|
||||
testResult->setResult(Result::MessageTestCaseStart);
|
||||
testResult->setDescription(tr("Executing test case %1").arg(className));
|
||||
testResultCreated(testResult);
|
||||
} else if (currentTag == QStringLiteral("TestFunction")) {
|
||||
testCase = xmlReader.attributes().value(QStringLiteral("name")).toString();
|
||||
QTC_ASSERT(!testCase.isEmpty(), continue);
|
||||
auto testResult = new TestResult();
|
||||
testResult->setResult(Result::MESSAGE_CURRENT_TEST);
|
||||
testResult->setResult(Result::MessageCurrentTest);
|
||||
testResult->setDescription(tr("Entering test function %1::%2").arg(className,
|
||||
testCase));
|
||||
testResultCreated(testResult);
|
||||
@@ -204,7 +204,7 @@ void TestXmlOutputReader::processOutput()
|
||||
description.clear();
|
||||
duration.clear();
|
||||
file.clear();
|
||||
result = Result::INVALID;
|
||||
result = Result::Invalid;
|
||||
lineNumber = 0;
|
||||
const QXmlStreamAttributes &attributes = xmlReader.attributes();
|
||||
result = TestResult::resultFromString(
|
||||
@@ -220,19 +220,19 @@ void TestXmlOutputReader::processOutput()
|
||||
const double value = attributes.value(QStringLiteral("value")).toDouble();
|
||||
const int iterations = attributes.value(QStringLiteral("iterations")).toInt();
|
||||
description = constructBenchmarkInformation(metric, value, iterations);
|
||||
result = Result::BENCHMARK;
|
||||
result = Result::Benchmark;
|
||||
} else if (currentTag == QStringLiteral("DataTag")) {
|
||||
cdataMode = DataTag;
|
||||
} else if (currentTag == QStringLiteral("Description")) {
|
||||
cdataMode = Description;
|
||||
} else if (currentTag == QStringLiteral("QtVersion")) {
|
||||
result = Result::MESSAGE_INTERNAL;
|
||||
result = Result::MessageInternal;
|
||||
cdataMode = QtVersion;
|
||||
} else if (currentTag == QStringLiteral("QtBuild")) {
|
||||
result = Result::MESSAGE_INTERNAL;
|
||||
result = Result::MessageInternal;
|
||||
cdataMode = QtBuild;
|
||||
} else if (currentTag == QStringLiteral("QTestVersion")) {
|
||||
result = Result::MESSAGE_INTERNAL;
|
||||
result = Result::MessageInternal;
|
||||
cdataMode = QTestVersion;
|
||||
}
|
||||
break;
|
||||
@@ -277,14 +277,14 @@ void TestXmlOutputReader::processOutput()
|
||||
if (!duration.isEmpty()) {
|
||||
auto testResult = new TestResult(className);
|
||||
testResult->setTestCase(testCase);
|
||||
testResult->setResult(Result::MESSAGE_INTERNAL);
|
||||
testResult->setResult(Result::MessageInternal);
|
||||
testResult->setDescription(tr("Execution took %1 ms.").arg(duration));
|
||||
testResultCreated(testResult);
|
||||
}
|
||||
emit increaseProgress();
|
||||
} else if (currentTag == QStringLiteral("TestCase") && !duration.isEmpty()) {
|
||||
auto testResult = new TestResult(className);
|
||||
testResult->setResult(Result::MESSAGE_TEST_CASE_END);
|
||||
testResult->setResult(Result::MessageTestCaseEnd);
|
||||
testResult->setDescription(tr("Test execution took %1 ms.").arg(duration));
|
||||
testResultCreated(testResult);
|
||||
} else if (validEndTags.contains(currentTag.toString())) {
|
||||
|
Reference in New Issue
Block a user