MCPcopy Create free account
hub / github.com/KDE/kdevelop / parseAndCheck

Method parseAndCheck

plugins/qmljs/tests/test_files.cpp:99–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99void TestFiles::parseAndCheck(const QString& fileName, bool check)
100{
101 const IndexedString indexedFileName(fileName);
102 ReferencedTopDUContext top =
103 DUChain::self()->waitForUpdate(indexedFileName, KDevelop::TopDUContext::AllDeclarationsContextsAndUses);
104
105 while (!ICore::self()->languageController()->backgroundParser()->isIdle()) {
106 QTest::qWait(500);
107 }
108
109 QVERIFY(top);
110
111 if (check) {
112 DUChainReadLocker lock;
113 DeclarationValidator validator;
114 top->visit(validator);
115 QVERIFY(validator.testsPassed());
116
117 if (!top->problems().isEmpty()) {
118 foreach(auto p, top->problems()) {
119 qDebug() << p;
120 }
121 }
122 if (!QTest::currentDataTag() || strcmp("failparse.js", QTest::currentDataTag()) != 0) {
123 QEXPECT_FAIL("plugins.qml", "not working properly yet", Continue);
124 QEXPECT_FAIL("qrc_import.qml", "just making sure it does not crash", Continue);
125 QVERIFY(top->problems().isEmpty());
126 }
127 }
128}
129
130#include "moc_test_files.cpp"

Callers

nothing calls this directly

Calls 8

waitForUpdateMethod · 0.80
backgroundParserMethod · 0.80
languageControllerMethod · 0.80
testsPassedMethod · 0.80
isIdleMethod · 0.45
visitMethod · 0.45
isEmptyMethod · 0.45
problemsMethod · 0.45

Tested by

no test coverage detected