| 97 | } |
| 98 | |
| 99 | void 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" |
nothing calls this directly
no test coverage detected