CppEditor: Tweak test infrastructure

... so we can re-use the "follow symbol" test cases with clangd.

Call Creator like this (clangd needs to be version 12 or later):
$ QTC_CLANGD=<path to clangd> qtcreator -test
'CppEditor,*Follow*,*Switch*' -test 'ClangCodeModel,*dummy*'

During testing, some invalid code in the test cases was uncovered and
fixed.

Change-Id: I9dc650fdba2a27600e6a550420ee873f6fb31d23
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2021-05-19 13:22:49 +02:00
parent 003ab51c3d
commit ff0301635e
16 changed files with 207 additions and 40 deletions

View File

@@ -6257,6 +6257,10 @@ void TextEditorWidget::findLinkAt(const QTextCursor &cursor,
bool TextEditorWidget::openLink(const Utils::Link &link, bool inNextSplit)
{
#ifdef WITH_TESTS
struct Signaller { ~Signaller() { emit EditorManager::instance()->linkOpened(); } } s;
#endif
if (!link.hasValidTarget())
return false;