forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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();
|
||||
|
@@ -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");
|
||||
|
||||
|
@@ -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))
|
||||
|
@@ -35,6 +35,8 @@ class CppEditorWidget;
|
||||
|
||||
namespace Internal::Tests {
|
||||
|
||||
bool isClangFormatPresent();
|
||||
|
||||
class CppTestDocument;
|
||||
typedef QSharedPointer<CppTestDocument> TestDocumentPtr;
|
||||
|
||||
|
Reference in New Issue
Block a user