diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2021-08-25 11:06:31 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2021-08-26 08:38:44 +0000 |
commit | 245b6c0dc73087678de941652f8c752bb49995cf (patch) | |
tree | e257648997e3fec24bb4206462099662e452a536 /src/plugins/cpptools/cpptoolsplugin.cpp | |
parent | 9796f88fd57119aac400e63de148d4ee442a4119 (diff) | |
download | qt-creator-245b6c0dc73087678de941652f8c752bb49995cf.tar.gz |
CppTools: Use test objects to group related test functions
Change-Id: I9ed2ad222579f49c20c75a53c862bb7251cff28d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cpptoolsplugin.cpp')
-rw-r--r-- | src/plugins/cpptools/cpptoolsplugin.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index dc619f29c3..7eb0c916ee 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -24,6 +24,7 @@ ****************************************************************************/ #include "cpptoolsplugin.h" + #include "cppcodemodelsettingspage.h" #include "cppcodestylesettingspage.h" #include "cppfilesettingspage.h" @@ -59,6 +60,24 @@ #include <utils/mimetypes/mimedatabase.h> #include <utils/qtcassert.h> +#ifdef WITH_TESTS +#include "compileroptionsbuilder_test.h" +#include "cppcodegen_test.h" +#include "cppcompletion_test.h" +#include "cppheadersource_test.h" +#include "cpplocalsymbols_test.h" +#include "cpplocatorfilter_test.h" +#include "cppmodelmanager_test.h" +#include "cpppointerdeclarationformatter_test.h" +#include "cppsourceprocessor_test.h" +#include "functionutils.h" +#include "includeutils.h" +#include "projectinfo_test.h" +#include "senddocumenttracker.h" +#include "symbolsearcher_test.h" +#include "typehierarchybuilder_test.h" +#endif + #include <QFileInfo> #include <QDir> #include <QDebug> @@ -234,6 +253,32 @@ void CppToolsPlugin::extensionsInitialized() d->m_clangdSettingsPage = new ClangdSettingsPage; } +QVector<QObject *> CppToolsPlugin::createTestObjects() const +{ + return { +#ifdef WITH_TESTS + new CodegenTest, + new CompilerOptionsBuilderTest, + new CompletionTest, + new FunctionUtilsTest, + new HeaderPathFilterTest, + new HeaderSourceTest, + new IncludeGroupsTest, + new LocalSymbolsTest, + new LocatorFilterTest, + new ModelManagerTest, + new PointerDeclarationFormatterTest, + new ProjectFileCategorizerTest, + new ProjectInfoGeneratorTest, + new ProjectPartChooserTest, + new DocumentTrackerTest, + new SourceProcessorTest, + new SymbolSearcherTest, + new TypeHierarchyBuilderTest, +#endif + }; +} + CppCodeModelSettings *CppToolsPlugin::codeModelSettings() { return &d->m_codeModelSettings; @@ -241,7 +286,7 @@ CppCodeModelSettings *CppToolsPlugin::codeModelSettings() CppFileSettings *CppToolsPlugin::fileSettings() { - return &d->m_fileSettings; + return &instance()->d->m_fileSettings; } void CppToolsPlugin::switchHeaderSource() |