summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2022-02-17 16:12:02 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2022-02-18 12:40:44 +0000
commit5866f78049fbd61ff6caeddb61303ca5354d58da (patch)
treee7277c4fd503ce623d03849b5c619bdd8b4a3d3a /src
parentf87c25acb51f4d55c6327e08e665b7bbb404e188 (diff)
downloadqt-creator-5866f78049fbd61ff6caeddb61303ca5354d58da.tar.gz
ClangCodeModel: Fix libclang tests
We must make sure clangd doesn't get in the way. Change-Id: Ica053cce6928920b39602c7c467b5d16f8232fe6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp9
-rw-r--r--src/plugins/clangcodemodel/test/clangcodecompletion_test.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp
index cdcb78742e..4fa51c94b7 100644
--- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp
+++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp
@@ -35,10 +35,12 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/icore.h>
+#include <cppeditor/cppcodemodelsettings.h>
#include <cppeditor/cpptoolsreuse.h>
#include <cppeditor/cpptoolstestcase.h>
#include <cppeditor/modelmanagertesthelper.h>
#include <cppeditor/projectinfo.h>
+#include <languageclient/languageclientmanager.h>
#include <texteditor/codeassist/assistproposalitem.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/textdocument.h>
@@ -514,6 +516,13 @@ namespace ClangCodeModel {
namespace Internal {
namespace Tests {
+void ClangCodeCompletionTest::initTestCase()
+{
+ CppEditor::ClangdSettings::setUseClangd(false);
+ for (LanguageClient::Client * const c : LanguageClient::LanguageClientManager::clients())
+ LanguageClient::LanguageClientManager::shutdownClient(c);
+}
+
void ClangCodeCompletionTest::testCompleteDoxygenKeywords()
{
ProjectLessCompletionTest t("doxygenKeywordsCompletion.cpp");
diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.h b/src/plugins/clangcodemodel/test/clangcodecompletion_test.h
index cf8bac668e..ad2dd83ada 100644
--- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.h
+++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.h
@@ -38,6 +38,8 @@ class ClangCodeCompletionTest : public QObject
Q_OBJECT
private slots:
+ void initTestCase();
+
void testCompleteDoxygenKeywords();
void testCompletePreprocessorKeywords();
void testCompleteIncludeDirective();