D18567: Make testActiveDocumentsGetBestPriority() clean up after itself

Thomas Schöps noreply at phabricator.kde.org
Thu Feb 14 00:55:47 GMT 2019


thomassc updated this revision to Diff 51637.
thomassc added a comment.


  Regarding waiting for the background parser on `TestFile` 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 `Q_ASSERT(ICore::self()->languageController()->backgroundParser()->isIdle());` 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.
  
  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 `m_documentController->closeAllDocuments();`. 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 `Q_ASSERT(ICore::self()->documentController()->openDocuments().isEmpty());` similarly to the case above to ensure that the tests clean up after themselves. Would you be fine with that?

REPOSITORY
  R32 KDevelop

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D18567?vs=50389&id=51637

REVISION DETAIL
  https://phabricator.kde.org/D18567

AFFECTED FILES
  plugins/clang/tests/test_duchain.cpp

To: thomassc, #kdevelop, mwolff
Cc: mwolff, kdevelop-devel, gennad, glebaccon, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190214/0d4761c0/attachment.html>


More information about the KDevelop-devel mailing list