Commit 036c6486 authored by Christian Stenger's avatar Christian Stenger
Browse files

Don't cancel test run if some test configurations are faulty

Instead just remove these from the current test run and add a
respective warning to the test results pane.

Additionally made a the message of having no test cases at all
a warning instead of a fatal.
parent b0c4a9cc
......@@ -46,7 +46,7 @@ ResultType TestResult::resultFromString(const QString &resultString)
return SKIP;
if (resultString == QLatin1String("qdebug"))
return MESSAGE_DEBUG;
if (resultString == QLatin1String("warn"))
if (resultString == QLatin1String("warn") || resultString == QLatin1String("qwarn"))
return MESSAGE_WARN;
if (resultString == QLatin1String("qfatal"))
return MESSAGE_FATAL;
......
......@@ -343,9 +343,25 @@ void TestRunner::runTests()
// clear old log and output pane
TestResultsPane::instance()->clearContents();
// handle faulty test configurations
QList<TestConfiguration *> toBeRemoved;
foreach (TestConfiguration *config, m_selectedTests)
if (!config->project()) {
toBeRemoved.append(config);
TestResultsPane::instance()->addTestResult(
TestResult(QString(), QString(), QString(), ResultType::MESSAGE_WARN,
tr("*** Project is null for '%1' - removing from Test Run ***\n"
"This might be the case for a faulty environment or similar."
).arg(config->displayName())));
}
foreach (TestConfiguration *config, toBeRemoved) {
m_selectedTests.removeOne(config);
delete config;
}
if (m_selectedTests.empty()) {
TestResultsPane::instance()->addTestResult(
TestResult(QString(), QString(), QString(), ResultType::MESSAGE_FATAL,
TestResult(QString(), QString(), QString(), ResultType::MESSAGE_WARN,
tr("*** No tests selected - canceling Test Run ***")));
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment