qmljs: fix tst_dependencies

Fixed the dependencies test.

Now it makes sure that all dependencies are loaded before evaluating
the checks, otherwise a race condition in the link process (QTCREATORBUG-25240) might give problems.
This requires running the event loop to ensure that the invokeMethod
in PluginDumper::loadPluginTypes creates the futures in the model
manager.

Change-Id: I4c0dd5cc948917e2a74fd46c3b66ee3bb5370da4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Fawzi Mohamed
2021-01-14 02:07:56 +01:00
parent 700da528b8
commit c532076bfd

View File

@@ -151,7 +151,9 @@ void tst_Dependencies::test()
lPaths.maybeInsert(Utils::FilePath::fromString(p), Dialect::Qml); lPaths.maybeInsert(Utils::FilePath::fromString(p), Dialect::Qml);
ModelManagerInterface::importScan(result, ModelManagerInterface::workingCopy(), lPaths, ModelManagerInterface::importScan(result, ModelManagerInterface::workingCopy(), lPaths,
ModelManagerInterface::instance(), false); ModelManagerInterface::instance(), false);
QCoreApplication::processEvents();
ModelManagerInterface::instance()->test_joinAllThreads();
QCoreApplication::processEvents();
TestData data = testData(filename); TestData data = testData(filename);
Document::MutablePtr doc = data.doc; Document::MutablePtr doc = data.doc;
int nExpectedSemanticMessages = data.semanticMessages; int nExpectedSemanticMessages = data.semanticMessages;