AutoTest: Allow re-parsing with a sub-set of parsers

Avoid expanding parsing over all parsers if we trigger a
re-parse for a different parser and there is already a
re-parse postponed.

Change-Id: If74480fea2c671b32083fb7cf3f4dc4c418e6e33
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2019-09-06 12:16:46 +02:00
parent c5f7de0a99
commit 42edcc5771
2 changed files with 45 additions and 37 deletions

View File

@@ -57,7 +57,6 @@ public:
};
explicit TestCodeParser(TestTreeModel *parent = nullptr);
virtual ~TestCodeParser();
void setState(State state);
State state() const { return m_parserState; }
bool isParsing() const { return m_parserState == PartialParse || m_parserState == FullParse; }
@@ -77,7 +76,7 @@ signals:
public:
void emitUpdateTestTree(ITestParser *parser = nullptr);
void updateTestTree(ITestParser *parser = nullptr);
void updateTestTree(const QSet<Core::Id> &frameworkIds = {});
void onCppDocumentUpdated(const CPlusPlus::Document::Ptr &document);
void onQmlDocumentUpdated(const QmlJS::Document::Ptr &document);
void onStartupProjectChanged(ProjectExplorer::Project *project);
@@ -86,7 +85,8 @@ public:
private:
bool postponed(const QStringList &fileList);
void scanForTests(const QStringList &fileList = QStringList(), ITestParser *parser = nullptr);
void scanForTests(const QStringList &fileList = QStringList(),
const QList<Core::Id> &parserIds = {});
// qml files must be handled slightly different
void onDocumentUpdated(const QString &fileName, bool isQmlFile = false);
@@ -108,9 +108,9 @@ private:
QSet<QString> m_postponedFiles;
State m_parserState = Idle;
QFutureWatcher<TestParseResultPtr> m_futureWatcher;
QVector<ITestParser *> m_testCodeParsers; // ptrs are still owned by TestFrameworkManager
QList<ITestParser *> m_testCodeParsers; // ptrs are still owned by TestFrameworkManager
QTimer m_reparseTimer;
ITestParser *m_updateParser = nullptr;
QSet<Core::Id> m_updateParsers;
QThreadPool *m_threadPool = nullptr;
};