forked from qt-creator/qt-creator
QmlJS: Track futures to allow testing
Tests often want to wait for all async tasks to finish before progressing. Change-Id: I61738df730ca341b5c9d227569d961cd1991b296 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Philip Van Hoof <philip@codeminded.be>
This commit is contained in:
@@ -179,8 +179,9 @@ public:
|
||||
virtual ProjectInfo defaultProjectInfoForProject(ProjectExplorer::Project *project) const;
|
||||
|
||||
|
||||
// Blocks until all parsing threads are done. Used for testing.
|
||||
void joinAllThreads();
|
||||
// Blocks until all parsing threads are done. Use for testing only!
|
||||
void test_joinAllThreads();
|
||||
void addFuture(const QFuture<void> &future);
|
||||
|
||||
QmlJS::Document::Ptr ensuredGetDocumentForPath(const QString &filePath);
|
||||
static void importScan(QFutureInterface<void> &future, const WorkingCopy& workingCopyInternal,
|
||||
@@ -271,7 +272,9 @@ private:
|
||||
|
||||
PluginDumper *m_pluginDumper = nullptr;
|
||||
|
||||
mutable QMutex m_futuresMutex;
|
||||
QList<QFuture<void>> m_futures;
|
||||
|
||||
bool m_indexerDisabled = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user