From a2a4fe564a170dd65f509e63e77fdf65a78a5c6b Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 5 Nov 2014 15:52:34 +0100 Subject: [PATCH] Cancel process when timeout is reached... ...and display fatal messages on the summary as well. --- plugins/autotest/testresultspane.cpp | 4 ++++ plugins/autotest/testrunner.cpp | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/plugins/autotest/testresultspane.cpp b/plugins/autotest/testresultspane.cpp index e903aecffd8..d14b7567cae 100644 --- a/plugins/autotest/testresultspane.cpp +++ b/plugins/autotest/testresultspane.cpp @@ -309,6 +309,10 @@ void TestResultsPane::updateSummaryLabel() if (count) labelText.append(QString::fromLatin1(", %1 %2") .arg(QString::number(count), tr("expected fails"))); + count = m_model->resultTypeCount(ResultType::MESSAGE_FATAL); + if (count) + labelText.append(QString::fromLatin1(", %1 %2") + .arg(QString::number(count), tr("fatals"))); labelText.append(QLatin1String(".

")); m_summaryLabel->setText(labelText); } diff --git a/plugins/autotest/testrunner.cpp b/plugins/autotest/testrunner.cpp index 4591f94081f..fb4028edf09 100644 --- a/plugins/autotest/testrunner.cpp +++ b/plugins/autotest/testrunner.cpp @@ -288,6 +288,14 @@ bool performExec(const QString &cmd, const QStringList &args, const QString &wor if (ok && executionTimer.elapsed() < timeout) { return m_runner->exitCode() == 0; } else { + if (m_runner->state() != QProcess::NotRunning) { + m_runner->kill(); + m_runner->waitForFinished(); + TestResultsPane::instance()->addTestResult( + TestResult(QString(), QString(), QString(), ResultType::MESSAGE_FATAL, + QObject::tr("*** Test Case canceled due to timeout ***\n" + "Maybe raise the timeout?"))); + } return false; } }