Autotest: Use QPromise for async calls

Change-Id: I57d2feed36eeb1871b2b00cf7720c48f6a0e81b5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-02-12 01:31:47 +01:00
parent 10a97e1f0e
commit 8285c85725
12 changed files with 30 additions and 33 deletions

View File

@@ -292,7 +292,7 @@ static bool isQObject(const CPlusPlus::Document::Ptr &declaringDoc)
|| file.endsWith("QtCore/qobject.h") || file.endsWith("kernel/qobject.h");
}
bool QtTestParser::processDocument(QFutureInterface<TestParseResultPtr> &futureInterface,
bool QtTestParser::processDocument(QPromise<TestParseResultPtr> &promise,
const FilePath &fileName)
{
CPlusPlus::Document::Ptr doc = document(fileName);
@@ -325,7 +325,7 @@ bool QtTestParser::processDocument(QFutureInterface<TestParseResultPtr> &futureI
data.multipleTestCases = testCase.multipleTestCases;
QtTestParseResult *parseResult
= createParseResult(testCase.name, data, projectParts.first()->projectFile);
futureInterface.reportResult(TestParseResultPtr(parseResult));
promise.addResult(TestParseResultPtr(parseResult));
reported = true;
}
}