<table><tr><td style="">thomassc updated this revision to Diff 51637.<br />thomassc added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D18567">View Revision</a></tr></table><br /><div><div><p>Regarding waiting for the background parser on <tt style="background: #ebebeb; font-size: 13px;">TestFile</tt> destruction, I didn't find a way to query whether a parse job is running or to wait for it, if it was started externally, using existing code (but I'm also not familiar with the codebase). As an alternative, one can do <tt style="background: #ebebeb; font-size: 13px;">Q_ASSERT(ICore::self()->languageController()->backgroundParser()->isIdle());</tt> in the test cleanup function to ensure that the tests don't leave the background parser running. This might also be a good idea to ensure that the tests don't influence each other in that way.</p>

<p>Regarding document handling, I'm not sure whether it's worth adding a specific test class for the few cases here. I found that in test_buddies.cpp, the test cleanup function does <tt style="background: #ebebeb; font-size: 13px;">m_documentController->closeAllDocuments();</tt>. I tried this for the duchain test, but this caused a crash when this actually tried to close the open documents, which I wasn't motivated to debug. Alternatively, one can do <tt style="background: #ebebeb; font-size: 13px;">Q_ASSERT(ICore::self()->documentController()->openDocuments().isEmpty());</tt> similarly to the case above to ensure that the tests clean up after themselves. Would you be fine with that?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D18567?vs=50389&id=51637">https://phabricator.kde.org/D18567?vs=50389&id=51637</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D18567">https://phabricator.kde.org/D18567</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/clang/tests/test_duchain.cpp</div></div></div><br /><div><strong>To: </strong>thomassc, KDevelop, mwolff<br /><strong>Cc: </strong>mwolff, kdevelop-devel, gennad, glebaccon, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd<br /></div>