AutoTest: Use working copy of own parser

In TestCodeParser::syncTestFrameworks(), a parser is created for every
test framework. As a result, the last parser being created would "win"
the global s_parserInstance variable, which is not predictable and
probably not intended. So turn CppParser::getFileContent() into a non-
static method, avoiding the global variable altogether.

Change-Id: I9f7560f1185bc4a3bc7b2b36e89280351998465e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Bernhard Beschow
2021-01-01 19:19:10 +01:00
parent d8c1e51bfe
commit 5d7f2d7444
9 changed files with 71 additions and 103 deletions

View File

@@ -80,7 +80,7 @@ public:
explicit CppParser(ITestFramework *framework);
void init(const QStringList &filesToParse, bool fullParse) override;
static bool selectedForBuilding(const QString &fileName);
static QByteArray getFileContent(const QString &filePath);
QByteArray getFileContent(const QString &filePath) const;
void release() override;
CPlusPlus::Document::Ptr document(const QString &fileName);