Commit 13e0abf5 authored by Christian Stenger's avatar Christian Stenger

AutoTest: Copy parse results only if necessary

Copying of the results is quite costly, so reduce this to a minimum.

Change-Id: I8db3bcd72c34ddd0bdc622ec3f2fd538c9679955
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent ac659dd2
......@@ -482,7 +482,6 @@ static void handleGTest(QFutureInterface<TestParseResult> futureInterface, const
if (ppList.size())
proFile = ppList.at(0)->projectFile;
QVector<TestParseResult> parseResults;
foreach (const GTestCaseSpec &testSpec, result.keys()) {
TestParseResult parseResult(TestTreeModel::GoogleTest);
parseResult.fileName = filePath;
......@@ -490,10 +489,8 @@ static void handleGTest(QFutureInterface<TestParseResult> futureInterface, const
parseResult.parameterized = testSpec.parameterized;
parseResult.referencingFile = proFile;
parseResult.dataTagsOrTestSets.insert(QString(), result.value(testSpec));
parseResults.append(parseResult);
futureInterface.reportResult(parseResult);
}
if (parseResults.size())
futureInterface.reportResults(parseResults);
}
static void checkDocumentForTestCode(QFutureInterface<TestParseResult> futureInterface,
......
......@@ -742,7 +742,7 @@ static TestTreeItem *constructGTestTreeItem(const TestParseResult &result)
return item;
}
void TestTreeModel::onParseResultReady(TestParseResult result)
void TestTreeModel::onParseResultReady(const TestParseResult &result)
{
switch (result.type) {
case AutoTest:
......
......@@ -89,7 +89,7 @@ signals:
public slots:
private:
void onParseResultReady(TestParseResult result);
void onParseResultReady(const TestParseResult &result);
void handleParseResult(const TestParseResult &result);
void handleUnnamedQuickParseResult(const TestParseResult &result);
void handleGTestParseResult(const TestParseResult &result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment