AutoTest: Re-use snapshot instead of fetching it while visiting

Change-Id: Ia41da67cb1fa047473b84baebafdbcaf6586c7ae
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Christian Stenger
2016-09-29 13:58:43 +02:00
parent bc14dc223f
commit 9050f19046
3 changed files with 14 additions and 12 deletions

View File

@@ -101,7 +101,7 @@ static QString testClass(const CppTools::CppModelManager *modelManager,
document = snapshot.preprocessedDocument(fileContent, fileName);
document->check();
CPlusPlus::AST *ast = document->translationUnit()->ast();
TestAstVisitor astVisitor(document);
TestAstVisitor astVisitor(document, snapshot);
astVisitor.accept(ast);
return astVisitor.className();
}
@@ -178,7 +178,7 @@ static bool handleQtTest(QFutureInterface<TestParseResultPtr> futureInterface,
if (declaringDoc.isNull())
return false;
TestVisitor visitor(testCaseName);
TestVisitor visitor(testCaseName, snapshot);
visitor.accept(declaringDoc->globalNamespace());
if (!visitor.resultValid())
return false;