aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2016-01-19 12:02:07 +0100
committerChristian Stenger <christian.stenger@theqtcompany.com>2016-01-19 11:52:07 +0000
commit06e02480f4d72f588b165fa32263c37fa508b5ba (patch)
tree83807b98d07f88b74144fcb20c86b1146d9f9569
parent9a3efd49503afd728dd45a8cb4610036fb1c4ebe (diff)
Use Utils::runAsync instead of QtConcurrent::run
QtConcurrent has the issue that it uses a globally shared thread pool, with no finer granularity for simulataneous tasks. Create an explicit event loop for the test runner for that. Change-Id: Idcf2f125e111d94a5a60e5b136fd875225326e14 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
-rw-r--r--plugins/autotest/testcodeparser.cpp2
-rw-r--r--plugins/autotest/testrunner.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/plugins/autotest/testcodeparser.cpp b/plugins/autotest/testcodeparser.cpp
index 9270a6d454..556fc735e2 100644
--- a/plugins/autotest/testcodeparser.cpp
+++ b/plugins/autotest/testcodeparser.cpp
@@ -800,7 +800,7 @@ void TestCodeParser::scanForTests(const QStringList &fileList)
return;
}
- QFuture<void> future = QtConcurrent::run(&performParse, list, this);
+ QFuture<void> future = Utils::runAsync<void>(&performParse, list, this);
Core::FutureProgress *progress
= Core::ProgressManager::addTask(future, isFullParse ? tr("Scanning for Tests")
: tr("Refreshing Tests List"),
diff --git a/plugins/autotest/testrunner.cpp b/plugins/autotest/testrunner.cpp
index 67f9ead4f6..cde0dde4bf 100644
--- a/plugins/autotest/testrunner.cpp
+++ b/plugins/autotest/testrunner.cpp
@@ -109,6 +109,7 @@ static void performTestRun(QFutureInterface<void> &futureInterface,
const QList<TestConfiguration *> selectedTests, const int timeout,
const QString metricsOption)
{
+ QEventLoop eventLoop;
int testCaseCount = 0;
foreach (TestConfiguration *config, selectedTests) {
config->completeTestInformation();
@@ -198,7 +199,7 @@ static void performTestRun(QFutureInterface<void> &futureInterface,
emitTestResultCreated(new FaultyTestResult(Result::MessageFatal,
QObject::tr("Test run canceled by user.")));
}
- qApp->processEvents();
+ eventLoop.processEvents();
}
}
@@ -274,8 +275,8 @@ void TestRunner::runTests()
TestResultsPane::instance(), &TestResultsPane::addTestResult,
Qt::QueuedConnection);
- QFuture<void> future = QtConcurrent::run(&performTestRun, m_selectedTests, settings->timeout,
- metricsOption);
+ QFuture<void> future = Utils::runAsync<void>(&performTestRun, m_selectedTests, settings->timeout,
+ metricsOption);
Core::FutureProgress *progress = Core::ProgressManager::addTask(future, tr("Running Tests"),
Autotest::Constants::TASK_INDEX);