Autotest: Move Test{FrameWorkManager,Runner} singletons

Make them plugin-pimpl data members, removing some indirections.

Change-Id: Ie441ac94a27f07342513b0b5b1437ccfe4b5d7d2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-03-26 09:21:25 +01:00
parent bac32dc740
commit f3c1751965
5 changed files with 31 additions and 39 deletions

View File

@@ -82,14 +82,13 @@ static TestRunner *s_instance = nullptr;
TestRunner *TestRunner::instance()
{
if (!s_instance)
s_instance = new TestRunner;
return s_instance;
}
TestRunner::TestRunner(QObject *parent) :
QObject(parent)
TestRunner::TestRunner()
{
s_instance = this;
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::resultReadyAt,
this, [this](int index) { emit testResultReady(m_futureWatcher.resultAt(index)); });
connect(&m_futureWatcher, &QFutureWatcher<TestResultPtr>::finished,