aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2024-02-28 17:23:41 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2024-02-29 14:46:11 +0000
commit3aa801ca9442167408835364cbb0a759ab0b5ee3 (patch)
tree83746cb964a14176c6942dce424c8093c5805f11
parent2e45d1d85ac3a62c44d42e6b1e0b4c1f3b19e2ab (diff)
CppEditor: Mark two tests as incompatible with ClangFormat
Change-Id: I95771a3f7fb78d0b7700dc52fdbe7c1e17d00f74 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--src/plugins/cppeditor/cppdoxygen_test.cpp8
-rw-r--r--src/plugins/cppeditor/cppquickfix_test.cpp8
-rw-r--r--src/plugins/cppeditor/cpptoolstestcase.cpp11
-rw-r--r--src/plugins/cppeditor/cpptoolstestcase.h2
4 files changed, 21 insertions, 8 deletions
diff --git a/src/plugins/cppeditor/cppdoxygen_test.cpp b/src/plugins/cppeditor/cppdoxygen_test.cpp
index c1799b3b45..2d85345303 100644
--- a/src/plugins/cppeditor/cppdoxygen_test.cpp
+++ b/src/plugins/cppeditor/cppdoxygen_test.cpp
@@ -495,6 +495,14 @@ void DoxygenTest::runTest(const QByteArray &original,
QCoreApplication::sendEvent(testDocument.m_editorWidget, &event);
const QByteArray result = testDocument.m_editorWidget->document()->toPlainText().toUtf8();
+ if (isClangFormatPresent()) {
+ QEXPECT_FAIL("noContinuationForExpressionAndComment1",
+ "ClangFormat indents differently",
+ Continue);
+ QEXPECT_FAIL("noContinuationForExpressionAndComment2",
+ "ClangFormat indents differently",
+ Continue);
+ }
QCOMPARE(QLatin1String(result), QLatin1String(expected));
testDocument.m_editorWidget->undo();
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp
index dd4817ea0d..ac9766414d 100644
--- a/src/plugins/cppeditor/cppquickfix_test.cpp
+++ b/src/plugins/cppeditor/cppquickfix_test.cpp
@@ -12,8 +12,6 @@
#include "cppsourceprocessertesthelper.h"
#include "cpptoolssettings.h"
-#include <extensionsystem/pluginmanager.h>
-#include <extensionsystem/pluginspec.h>
#include <utils/fileutils.h>
#include <QDebug>
@@ -5406,12 +5404,6 @@ void QuickfixTest::testInsertDefsFromDecls()
void QuickfixTest::testInsertAndFormatDefsFromDecls()
{
- static const auto isClangFormatPresent = [] {
- using namespace ExtensionSystem;
- return Utils::contains(PluginManager::plugins(), [](const PluginSpec *plugin) {
- return plugin->name() == "ClangFormat" && plugin->isEffectivelyEnabled();
- });
- };
if (!isClangFormatPresent())
QSKIP("This test reqires ClangFormat");
diff --git a/src/plugins/cppeditor/cpptoolstestcase.cpp b/src/plugins/cppeditor/cpptoolstestcase.cpp
index a55895affc..b0151e7a81 100644
--- a/src/plugins/cppeditor/cpptoolstestcase.cpp
+++ b/src/plugins/cppeditor/cpptoolstestcase.cpp
@@ -13,6 +13,9 @@
#include <coreplugin/editormanager/editormanager.h>
+#include <extensionsystem/pluginmanager.h>
+#include <extensionsystem/pluginspec.h>
+
#include <cplusplus/CppDocument.h>
#include <projectexplorer/buildsystem.h>
@@ -39,6 +42,14 @@ using namespace Utils;
namespace CppEditor::Internal::Tests {
+bool isClangFormatPresent()
+{
+ using namespace ExtensionSystem;
+ return Utils::contains(PluginManager::plugins(), [](const PluginSpec *plugin) {
+ return plugin->name() == "ClangFormat" && plugin->isEffectivelyEnabled();
+ });
+};
+
CppTestDocument::CppTestDocument(const QByteArray &fileName, const QByteArray &source,
char cursorMarker)
: m_fileName(QString::fromUtf8(fileName))
diff --git a/src/plugins/cppeditor/cpptoolstestcase.h b/src/plugins/cppeditor/cpptoolstestcase.h
index 13548630e6..99969621b3 100644
--- a/src/plugins/cppeditor/cpptoolstestcase.h
+++ b/src/plugins/cppeditor/cpptoolstestcase.h
@@ -35,6 +35,8 @@ class CppEditorWidget;
namespace Internal::Tests {
+bool isClangFormatPresent();
+
class CppTestDocument;
typedef QSharedPointer<CppTestDocument> TestDocumentPtr;