diff options
author | Christian Stenger <christian.stenger@theqtcompany.com> | 2014-11-19 08:52:40 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@theqtcompany.com> | 2014-12-04 13:52:16 +0100 |
commit | 036c648650f646427be06e054371eb1971386fff (patch) | |
tree | cfb0863259793f2a363941c65bcfe5fb240ed3f0 | |
parent | b0c4a9cc3bbe6697692c07c31c96a2c937171364 (diff) | |
download | qt-creator-036c648650f646427be06e054371eb1971386fff.tar.gz |
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.
-rw-r--r-- | plugins/autotest/testresult.cpp | 2 | ||||
-rw-r--r-- | plugins/autotest/testrunner.cpp | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/plugins/autotest/testresult.cpp b/plugins/autotest/testresult.cpp index e3b974113b..a784ec9b1a 100644 --- a/plugins/autotest/testresult.cpp +++ b/plugins/autotest/testresult.cpp @@ -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; diff --git a/plugins/autotest/testrunner.cpp b/plugins/autotest/testrunner.cpp index 420360468b..c7b582aab1 100644 --- a/plugins/autotest/testrunner.cpp +++ b/plugins/autotest/testrunner.cpp @@ -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; } |