forked from qt-creator/qt-creator
Clang*: Use new plugin test setup scheme
Change-Id: I636b93d74b4f9ab9ade28c46c6e84b461ccf34be Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -43,8 +43,7 @@ using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
namespace ClangCodeModel::Internal {
|
||||
|
||||
void ClangCodeModelPlugin::generateCompilationDB()
|
||||
{
|
||||
@@ -78,8 +77,7 @@ ClangCodeModelPlugin::~ClangCodeModelPlugin()
|
||||
|
||||
void ClangCodeModelPlugin::initialize()
|
||||
{
|
||||
TaskHub::addCategory(Constants::TASK_CATEGORY_DIAGNOSTICS,
|
||||
Tr::tr("Clang Code Model"));
|
||||
TaskHub::addCategory(Constants::TASK_CATEGORY_DIAGNOSTICS, Tr::tr("Clang Code Model"));
|
||||
|
||||
connect(ProjectExplorerPlugin::instance(),
|
||||
&ProjectExplorerPlugin::finishedInitialization,
|
||||
@@ -90,6 +88,18 @@ void ClangCodeModelPlugin::initialize()
|
||||
std::make_unique<ClangModelManagerSupport>());
|
||||
|
||||
createCompilationDBAction();
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
addTest<Tests::ActivationSequenceProcessorTest>();
|
||||
addTest<Tests::ClangdTestCompletion>();
|
||||
addTest<Tests::ClangdTestExternalChanges>();
|
||||
addTest<Tests::ClangdTestFindReferences>();
|
||||
addTest<Tests::ClangdTestFollowSymbol>();
|
||||
addTest<Tests::ClangdTestHighlighting>();
|
||||
addTest<Tests::ClangdTestLocalReferences>();
|
||||
addTest<Tests::ClangdTestTooltips>();
|
||||
addTest<Tests::ClangFixItTest>();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ClangCodeModelPlugin::createCompilationDBAction()
|
||||
@@ -178,22 +188,4 @@ void ClangCodeModelPlugin::maybeHandleBatchFileAndExit() const
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
QVector<QObject *> ClangCodeModelPlugin::createTestObjects() const
|
||||
{
|
||||
return {
|
||||
new Tests::ActivationSequenceProcessorTest,
|
||||
new Tests::ClangdTestCompletion,
|
||||
new Tests::ClangdTestExternalChanges,
|
||||
new Tests::ClangdTestFindReferences,
|
||||
new Tests::ClangdTestFollowSymbol,
|
||||
new Tests::ClangdTestHighlighting,
|
||||
new Tests::ClangdTestLocalReferences,
|
||||
new Tests::ClangdTestTooltips,
|
||||
new Tests::ClangFixItTest,
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Clang
|
||||
} // ClangCodeModel::Internal
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
|
||||
#include <QFutureWatcher>
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
namespace ClangCodeModel::Internal {
|
||||
|
||||
class ClangCodeModelPlugin final: public ExtensionSystem::IPlugin
|
||||
{
|
||||
@@ -31,10 +30,6 @@ private:
|
||||
|
||||
Utils::ParameterAction *m_generateCompilationDBAction = nullptr;
|
||||
QFutureWatcher<GenerateCompilationDbResult> m_generatorWatcher;
|
||||
#ifdef WITH_TESTS
|
||||
QVector<QObject *> createTestObjects() const override;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Clang
|
||||
} // ClangCodeModel::Internal
|
||||
|
||||
@@ -103,15 +103,10 @@ void ClangFormatPlugin::initialize()
|
||||
openClangFormatConfigAction->setData(doc->filePath().toVariant());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
QVector<QObject *> ClangFormatPlugin::createTestObjects() const
|
||||
{
|
||||
return {
|
||||
#ifdef WITH_TESTS
|
||||
new Internal::ClangFormatTest,
|
||||
addTest<Internal::ClangFormatTest>();
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace ClangFormat
|
||||
} // ClangFormat
|
||||
|
||||
@@ -16,7 +16,6 @@ class ClangFormatPlugin : public ExtensionSystem::IPlugin
|
||||
|
||||
~ClangFormatPlugin() override;
|
||||
void initialize() final;
|
||||
QVector<QObject *> createTestObjects() const override;
|
||||
|
||||
TextEditor::ICodeStylePreferencesFactory *m_factory = nullptr;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "clangtool.h"
|
||||
#include "clangtoolsconstants.h"
|
||||
#include "clangtoolsprojectsettings.h"
|
||||
#include "clangtoolsprojectsettingswidget.h"
|
||||
#include "clangtoolstr.h"
|
||||
#include "documentclangtoolrunner.h"
|
||||
@@ -49,8 +48,7 @@
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
namespace ClangTools::Internal {
|
||||
|
||||
static ProjectPanelFactory *m_projectPanelFactoryInstance = nullptr;
|
||||
|
||||
@@ -112,6 +110,12 @@ void ClangToolsPlugin::initialize()
|
||||
&Core::EditorManager::currentEditorChanged,
|
||||
this,
|
||||
&ClangToolsPlugin::onCurrentEditorChanged);
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
addTest<PreconfiguredSessionTests>();
|
||||
addTest<ClangToolsUnitTests>();
|
||||
addTest<ReadExportedDiagnosticsTest>();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ClangToolsPlugin::onCurrentEditorChanged()
|
||||
@@ -185,16 +189,4 @@ void ClangToolsPlugin::registerAnalyzeActions()
|
||||
});
|
||||
}
|
||||
|
||||
QVector<QObject *> ClangToolsPlugin::createTestObjects() const
|
||||
{
|
||||
QVector<QObject *> tests;
|
||||
#ifdef WITH_TESTS
|
||||
tests << new PreconfiguredSessionTests;
|
||||
tests << new ClangToolsUnitTests;
|
||||
tests << new ReadExportedDiagnosticsTest;
|
||||
#endif
|
||||
return tests;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ClangTools
|
||||
} // ClangTools::Internal
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
namespace Core { class IDocument; }
|
||||
namespace ProjectExplorer { class ProjectPanelFactory; }
|
||||
|
||||
namespace ClangTools {
|
||||
namespace Internal {
|
||||
namespace ClangTools::Internal {
|
||||
|
||||
ProjectExplorer::ProjectPanelFactory *projectPanelFactory();
|
||||
|
||||
@@ -27,10 +26,7 @@ private:
|
||||
void registerAnalyzeActions();
|
||||
void onCurrentEditorChanged();
|
||||
|
||||
QVector<QObject *> createTestObjects() const final;
|
||||
|
||||
class ClangToolsPluginPrivate *d = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ClangTools
|
||||
} // ClangTools::Internal
|
||||
|
||||
Reference in New Issue
Block a user