diff options
author | Christian Stenger <christian.stenger@qt.io> | 2017-03-14 09:16:01 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2017-03-28 05:07:04 +0000 |
commit | 0a3efc042df1538c30e840b33641d00cb2f724da (patch) | |
tree | 40bfdd1e9506f65a33d7ea213082cc4ed9dd1b42 | |
parent | 124efb32f5526f6e5391558897eee802ea9b8748 (diff) | |
download | qt-creator-0a3efc042df1538c30e840b33641d00cb2f724da.tar.gz |
AutoTest: Fix warning for guessed configs
The check whether to emit a warning regarding guessed
configurations must get evaluated after the configuration
has been completed otherwise the guessed flag would be
always false.
Change-Id: I20e6dcdfff5110d4d9128ffcc97cba1a70f44fe9
Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r-- | src/plugins/autotest/testrunner.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index 2e579e7dfa..acb59683f2 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -100,12 +100,19 @@ static void performTestRun(QFutureInterface<TestResultPtr> &futureInterface, const TestSettings &settings) { const int timeout = settings.timeout; + const bool omitRunConfigWarnings = settings.omitRunConfigWarn; QEventLoop eventLoop; int testCaseCount = 0; for (TestConfiguration *config : selectedTests) { config->completeTestInformation(TestRunner::Run); if (config->project()) { testCaseCount += config->testCaseCount(); + if (!omitRunConfigWarnings && config->guessedConfiguration()) { + futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageWarn, + TestRunner::tr("Project's run configuration was guessed for \"%1\".\n" + "This might cause trouble during execution." + ).arg(config->displayName())))); + } } else { futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageWarn, TestRunner::tr("Project is null for \"%1\". Removing from test run.\n" @@ -196,22 +203,12 @@ void TestRunner::prepareToRunTests(Mode mode) return; } - const bool omitRunConfigWarnings = AutotestPlugin::instance()->settings()->omitRunConfigWarn; - m_executingTests = true; emit testRunStarted(); // clear old log and output pane TestResultsPane::instance()->clearContents(); - for (TestConfiguration *config : m_selectedTests) { - if (!omitRunConfigWarnings && config->guessedConfiguration()) { - emit testResultReady(TestResultPtr(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()) { emit testResultReady(TestResultPtr(new FaultyTestResult(Result::MessageWarn, tr("No tests selected. Canceling test run.")))); |