diff options
author | Christian Stenger <[email protected]> | 2019-08-19 10:55:32 +0200 |
---|---|---|
committer | Christian Stenger <[email protected]> | 2019-09-02 09:04:16 +0000 |
commit | 03b80025a94542e9f6dc09ace431f82cfabfabd6 (patch) | |
tree | 5b7ea7c1fc1471da4b6d3cb776390a2e2a09abc2 /src | |
parent | df93c6c5a7bf476b0cf35ef5b8444c9fd5288d08 (diff) |
AutoTest: Shuffle namespaces for clearer separation
Change-Id: I6ac440c6d72c3d0dbcd75907f8a6ae756f3cf5ee
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src')
27 files changed, 56 insertions, 66 deletions
diff --git a/src/plugins/autotest/autotestconstants.h b/src/plugins/autotest/autotestconstants.h index 0f589b56aac..7bed3cf3466 100644 --- a/src/plugins/autotest/autotestconstants.h +++ b/src/plugins/autotest/autotestconstants.h @@ -50,7 +50,6 @@ const char TASK_MARK_ID[] = "Autotest.TaskMark"; const char SK_USE_GLOBAL[] = "AutoTest.UseGlobal"; } // namespace Constants -namespace Internal { enum class TestRunMode { None, @@ -60,5 +59,4 @@ enum class TestRunMode DebugWithoutDeploy, RunAfterBuild }; -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/autotestunittests.h b/src/plugins/autotest/autotestunittests.h index 3b464fc709e..0007875a3e5 100644 --- a/src/plugins/autotest/autotestunittests.h +++ b/src/plugins/autotest/autotestunittests.h @@ -30,10 +30,11 @@ namespace CppTools { namespace Tests { class TemporaryCopiedDir; } } namespace Autotest { -namespace Internal { class TestTreeModel; +namespace Internal { + class AutoTestUnitTests : public QObject { Q_OBJECT diff --git a/src/plugins/autotest/boost/boosttestsettingspage.h b/src/plugins/autotest/boost/boosttestsettingspage.h index 5e0e65f7b95..609bcf0b71b 100644 --- a/src/plugins/autotest/boost/boosttestsettingspage.h +++ b/src/plugins/autotest/boost/boosttestsettingspage.h @@ -31,9 +31,11 @@ #include <QPointer> namespace Autotest { -namespace Internal { class IFrameworkSettings; + +namespace Internal { + class BoostTestSettings; class BoostTestSettingsWidget : public QWidget diff --git a/src/plugins/autotest/gtest/gtestoutputreader.h b/src/plugins/autotest/gtest/gtestoutputreader.h index 6684b77f44e..96502255b81 100644 --- a/src/plugins/autotest/gtest/gtestoutputreader.h +++ b/src/plugins/autotest/gtest/gtestoutputreader.h @@ -33,7 +33,6 @@ namespace Autotest { namespace Internal { class GTestResult; -class TestTreeItem; class GTestOutputReader : public TestOutputReader { diff --git a/src/plugins/autotest/gtest/gtestsettingspage.h b/src/plugins/autotest/gtest/gtestsettingspage.h index 5bee96ec33b..f9066f961ec 100644 --- a/src/plugins/autotest/gtest/gtestsettingspage.h +++ b/src/plugins/autotest/gtest/gtestsettingspage.h @@ -32,9 +32,11 @@ #include <QPointer> namespace Autotest { -namespace Internal { class IFrameworkSettings; + +namespace Internal { + class GTestSettings; class GTestSettingsWidget : public QWidget diff --git a/src/plugins/autotest/iframeworksettings.h b/src/plugins/autotest/iframeworksettings.h index 51ff6a79fa7..3b09fad3d4f 100644 --- a/src/plugins/autotest/iframeworksettings.h +++ b/src/plugins/autotest/iframeworksettings.h @@ -30,7 +30,6 @@ #include <QSettings> namespace Autotest { -namespace Internal { class IFrameworkSettings { @@ -63,5 +62,4 @@ protected: virtual void fromFrameworkSettings(const QSettings *s) = 0; }; -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/itestframework.h b/src/plugins/autotest/itestframework.h index b90a0823d69..9753ccc12a6 100644 --- a/src/plugins/autotest/itestframework.h +++ b/src/plugins/autotest/itestframework.h @@ -29,7 +29,6 @@ #include "itestparser.h" namespace Autotest { -namespace Internal { class IFrameworkSettings; class ITestSettingsPage; @@ -84,5 +83,4 @@ private: bool m_grouping = false; }; -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/itestparser.cpp b/src/plugins/autotest/itestparser.cpp index 27000748ad0..f0310041d7f 100644 --- a/src/plugins/autotest/itestparser.cpp +++ b/src/plugins/autotest/itestparser.cpp @@ -30,7 +30,6 @@ #include <utils/textfileformat.h> namespace Autotest { -namespace Internal { static CppParser *s_parserInstance = nullptr; @@ -83,5 +82,4 @@ CPlusPlus::Document::Ptr CppParser::document(const QString &fileName) return selectedForBuilding(fileName) ? m_cppSnapshot.document(fileName) : nullptr; } -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/itestparser.h b/src/plugins/autotest/itestparser.h index 0aef8eb3a6d..d9a8c92801a 100644 --- a/src/plugins/autotest/itestparser.h +++ b/src/plugins/autotest/itestparser.h @@ -34,7 +34,6 @@ #include <qmljs/qmljsdocument.h> namespace Autotest { -namespace Internal { class TestParseResult { @@ -88,7 +87,6 @@ protected: CppTools::WorkingCopy m_workingCopy; }; -} // namespace Internal } // namespace Autotest -Q_DECLARE_METATYPE(Autotest::Internal::TestParseResultPtr) +Q_DECLARE_METATYPE(Autotest::TestParseResultPtr) diff --git a/src/plugins/autotest/itestsettingspage.h b/src/plugins/autotest/itestsettingspage.h index be4f05f491b..c985efca61f 100644 --- a/src/plugins/autotest/itestsettingspage.h +++ b/src/plugins/autotest/itestsettingspage.h @@ -31,7 +31,6 @@ #include <coreplugin/dialogs/ioptionspage.h> namespace Autotest { -namespace Internal { class IFrameworkSettings; @@ -64,5 +63,4 @@ private: } }; -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/qtest/qttestsettingspage.h b/src/plugins/autotest/qtest/qttestsettingspage.h index cb4e5850dcb..51fe5102e15 100644 --- a/src/plugins/autotest/qtest/qttestsettingspage.h +++ b/src/plugins/autotest/qtest/qttestsettingspage.h @@ -32,9 +32,11 @@ #include <QPointer> namespace Autotest { -namespace Internal { class IFrameworkSettings; + +namespace Internal { + class QtTestSettings; class QtTestSettingsWidget : public QWidget diff --git a/src/plugins/autotest/testconfiguration.cpp b/src/plugins/autotest/testconfiguration.cpp index a68306dfdd9..38704fe07c7 100644 --- a/src/plugins/autotest/testconfiguration.cpp +++ b/src/plugins/autotest/testconfiguration.cpp @@ -47,7 +47,6 @@ using namespace ProjectExplorer; using namespace Utils; namespace Autotest { -namespace Internal { TestConfiguration::~TestConfiguration() { @@ -103,7 +102,7 @@ void TestConfiguration::completeTestInformation(ProjectExplorer::RunConfiguratio m_buildDir = QFileInfo(buildBase + m_projectFile.mid(projBase.length())).absolutePath(); } if (runMode == TestRunMode::Debug || runMode == TestRunMode::DebugWithoutDeploy) - m_runConfig = new TestRunConfiguration(rc->target(), this); + m_runConfig = new Internal::TestRunConfiguration(rc->target(), this); } void TestConfiguration::completeTestInformation(TestRunMode runMode) @@ -202,7 +201,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode) m_runnable.executable = currentExecutable; m_displayName = runConfig->displayName(); if (runMode == TestRunMode::Debug || runMode == TestRunMode::DebugWithoutDeploy) - m_runConfig = new TestRunConfiguration(target, this); + m_runConfig = new Internal::TestRunConfiguration(target, this); break; } } @@ -223,7 +222,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode) m_deducedConfiguration = true; m_deducedFrom = rc->displayName(); if (runMode == TestRunMode::Debug) - m_runConfig = new TestRunConfiguration(rc->target(), this); + m_runConfig = new Internal::TestRunConfiguration(rc->target(), this); } else { qCDebug(LOG) << "not using the fallback as the current active run configuration " "appears to be non-Desktop"; @@ -351,5 +350,4 @@ bool TestConfiguration::hasExecutable() const return !m_runnable.executable.isEmpty(); } -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testconfiguration.h b/src/plugins/autotest/testconfiguration.h index fcd778c8ecd..56533f8a520 100644 --- a/src/plugins/autotest/testconfiguration.h +++ b/src/plugins/autotest/testconfiguration.h @@ -42,10 +42,12 @@ QT_END_NAMESPACE namespace Autotest { namespace Internal { +class TestRunConfiguration; +} // namespace Internal class TestOutputReader; class TestResult; -class TestRunConfiguration; +enum class TestRunMode; using TestResultPtr = QSharedPointer<TestResult>; @@ -82,7 +84,7 @@ public: ProjectExplorer::Project *project() const { return m_project.data(); } QSet<QString> internalTargets() const { return m_buildTargets; } ProjectExplorer::RunConfiguration *originalRunConfiguration() const { return m_origRunConfig; } - TestRunConfiguration *runConfiguration() const { return m_runConfig; } + Internal::TestRunConfiguration *runConfiguration() const { return m_runConfig; } bool hasExecutable() const; bool isDeduced() const { return m_deducedConfiguration; } QString runConfigDisplayName() const { return m_deducedConfiguration ? m_deducedFrom @@ -102,7 +104,7 @@ private: QString m_deducedFrom; QPointer<ProjectExplorer::Project> m_project; bool m_deducedConfiguration = false; - TestRunConfiguration *m_runConfig = nullptr; + Internal::TestRunConfiguration *m_runConfig = nullptr; QSet<QString> m_buildTargets; ProjectExplorer::RunConfiguration *m_origRunConfig = nullptr; ProjectExplorer::Runnable m_runnable; @@ -124,5 +126,4 @@ private: bool m_mixedDebugging = false; }; -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testframeworkmanager.cpp b/src/plugins/autotest/testframeworkmanager.cpp index fd8f1261183..97a264a8949 100644 --- a/src/plugins/autotest/testframeworkmanager.cpp +++ b/src/plugins/autotest/testframeworkmanager.cpp @@ -43,14 +43,13 @@ static Q_LOGGING_CATEGORY(LOG, "qtc.autotest.frameworkmanager", QtWarningMsg) namespace Autotest { -namespace Internal { static TestFrameworkManager *s_instance = nullptr; TestFrameworkManager::TestFrameworkManager() { m_testTreeModel = TestTreeModel::instance(); - m_testRunner = TestRunner::instance(); + m_testRunner = Internal::TestRunner::instance(); s_instance = this; } @@ -89,7 +88,7 @@ bool TestFrameworkManager::registerTestFramework(ITestFramework *framework) return true; } -void TestFrameworkManager::activateFrameworksFromSettings(QSharedPointer<TestSettings> settings) +void TestFrameworkManager::activateFrameworksFromSettings(QSharedPointer<Internal::TestSettings> settings) { FrameworkIterator it = m_registeredFrameworks.begin(); FrameworkIterator end = m_registeredFrameworks.end(); @@ -168,7 +167,7 @@ QSharedPointer<IFrameworkSettings> TestFrameworkManager::settingsForTestFramewor void TestFrameworkManager::synchronizeSettings(QSettings *s) { - AutotestPlugin::settings()->fromSettings(s); + Internal::AutotestPlugin::settings()->fromSettings(s); for (const Core::Id &id : m_frameworkSettings.keys()) { QSharedPointer<IFrameworkSettings> fSettings = settingsForTestFramework(id); if (!fSettings.isNull()) @@ -217,5 +216,4 @@ unsigned TestFrameworkManager::priority(const Core::Id &frameworkId) const return unsigned(-1); } -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testframeworkmanager.h b/src/plugins/autotest/testframeworkmanager.h index 7814ca2e819..f96a4a0b1f8 100644 --- a/src/plugins/autotest/testframeworkmanager.h +++ b/src/plugins/autotest/testframeworkmanager.h @@ -39,11 +39,14 @@ namespace Core { class Id; } namespace Autotest { namespace Internal { +class TestRunner; +struct TestSettings; + +} + class IFrameworkSettings; class ITestParser; class ITestSettingsPage; -class TestRunner; -struct TestSettings; class TestTreeItem; class TestTreeModel; @@ -54,7 +57,7 @@ public: virtual ~TestFrameworkManager(); bool registerTestFramework(ITestFramework *framework); - void activateFrameworksFromSettings(QSharedPointer<TestSettings> settings); + void activateFrameworksFromSettings(QSharedPointer<Internal::TestSettings> settings); QString frameworkNameForId(const Core::Id &id) const; QList<Core::Id> registeredFrameworkIds() const; QList<Core::Id> sortedRegisteredFrameworkIds() const; @@ -77,10 +80,9 @@ private: QHash<Core::Id, QSharedPointer<IFrameworkSettings> > m_frameworkSettings; QVector<ITestSettingsPage *> m_frameworkSettingsPages; TestTreeModel *m_testTreeModel; - TestRunner *m_testRunner; + Internal::TestRunner *m_testRunner; typedef QHash<Core::Id, ITestFramework *>::ConstIterator FrameworkIterator; }; -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testnavigationwidget.h b/src/plugins/autotest/testnavigationwidget.h index 422ade8c583..1160046b0bc 100644 --- a/src/plugins/autotest/testnavigationwidget.h +++ b/src/plugins/autotest/testnavigationwidget.h @@ -47,9 +47,11 @@ class ProgressIndicator; } namespace Autotest { -namespace Internal { class TestTreeModel; + +namespace Internal { + class TestTreeSortFilterModel; class TestTreeView; diff --git a/src/plugins/autotest/testoutputreader.cpp b/src/plugins/autotest/testoutputreader.cpp index 36da35543b3..087189f394f 100644 --- a/src/plugins/autotest/testoutputreader.cpp +++ b/src/plugins/autotest/testoutputreader.cpp @@ -33,7 +33,6 @@ #include <QProcess> namespace Autotest { -namespace Internal { TestOutputReader::TestOutputReader(const QFutureInterface<TestResultPtr> &futureInterface, QProcess *testApplication, const QString &buildDirectory) @@ -102,5 +101,4 @@ void TestOutputReader::reportResult(const TestResultPtr &result) m_hadValidOutput = true; } -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testoutputreader.h b/src/plugins/autotest/testoutputreader.h index 87216a2570c..763fe52ae7e 100644 --- a/src/plugins/autotest/testoutputreader.h +++ b/src/plugins/autotest/testoutputreader.h @@ -33,7 +33,6 @@ #include <QString> namespace Autotest { -namespace Internal { class TestOutputReader : public QObject { @@ -72,5 +71,4 @@ private: bool m_hadValidOutput = false; }; -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testresult.cpp b/src/plugins/autotest/testresult.cpp index e9ff367ef96..13e120f3cc8 100644 --- a/src/plugins/autotest/testresult.cpp +++ b/src/plugins/autotest/testresult.cpp @@ -29,7 +29,6 @@ #include <utils/theme/theme.h> namespace Autotest { -namespace Internal { TestResult::TestResult(const QString &id, const QString &name) : m_id(id) @@ -189,5 +188,4 @@ TestResult *TestResult::createIntermediateResultFor(const TestResult *other) return intermediate; } -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testresult.h b/src/plugins/autotest/testresult.h index 84fc2c144ae..0c7be084c37 100644 --- a/src/plugins/autotest/testresult.h +++ b/src/plugins/autotest/testresult.h @@ -33,7 +33,6 @@ #include <QSharedPointer> namespace Autotest { -namespace Internal { class TestTreeItem; @@ -119,8 +118,7 @@ private: using TestResultPtr = QSharedPointer<TestResult>; -} // namespace Internal } // namespace Autotest -Q_DECLARE_METATYPE(Autotest::Internal::TestResult) -Q_DECLARE_METATYPE(Autotest::Internal::ResultType) +Q_DECLARE_METATYPE(Autotest::TestResult) +Q_DECLARE_METATYPE(Autotest::ResultType) diff --git a/src/plugins/autotest/testresultspane.h b/src/plugins/autotest/testresultspane.h index 3f3a5b31f5d..2b24ee38017 100644 --- a/src/plugins/autotest/testresultspane.h +++ b/src/plugins/autotest/testresultspane.h @@ -48,11 +48,13 @@ class IContext; } namespace Autotest { + +class TestResult; + namespace Internal { class TestResultModel; class TestResultFilterModel; -class TestResult; class TestEditorMark; class ResultsTreeView : public Utils::TreeView diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index 0e622901014..19611715f59 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -313,8 +313,8 @@ void TestRunner::prepareToRunTests(TestRunMode mode) m_runMode = mode; ProjectExplorer::Internal::ProjectExplorerSettings projectExplorerSettings = ProjectExplorer::ProjectExplorerPlugin::projectExplorerSettings(); - if (mode != TestRunMode::RunAfterBuild && - projectExplorerSettings.buildBeforeDeploy && !projectExplorerSettings.saveBeforeBuild) { + if (mode != TestRunMode::RunAfterBuild && projectExplorerSettings.buildBeforeDeploy + && !projectExplorerSettings.saveBeforeBuild) { if (!ProjectExplorer::ProjectExplorerPlugin::saveModifiedFiles()) return; } diff --git a/src/plugins/autotest/testrunner.h b/src/plugins/autotest/testrunner.h index 185bfa0db57..48d9f2ecab9 100644 --- a/src/plugins/autotest/testrunner.h +++ b/src/plugins/autotest/testrunner.h @@ -48,6 +48,9 @@ class Project; } namespace Autotest { + +enum class TestRunMode; + namespace Internal { class AUTOTESTSHARED_EXPORT TestRunner : public QObject diff --git a/src/plugins/autotest/testtreeitem.cpp b/src/plugins/autotest/testtreeitem.cpp index 3559ae20357..b3db358f5ef 100644 --- a/src/plugins/autotest/testtreeitem.cpp +++ b/src/plugins/autotest/testtreeitem.cpp @@ -37,7 +37,6 @@ #include <QIcon> namespace Autotest { -namespace Internal { TestTreeItem::TestTreeItem(const QString &name, const QString &filePath, Type type) : m_name(name), @@ -379,5 +378,4 @@ QSet<QString> TestTreeItem::dependingInternalTargets(CppTools::CppModelManager * return result; } -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testtreeitem.h b/src/plugins/autotest/testtreeitem.h index a311043558d..ad86dcb8425 100644 --- a/src/plugins/autotest/testtreeitem.h +++ b/src/plugins/autotest/testtreeitem.h @@ -45,10 +45,9 @@ namespace CppTools { class CppModelManager; } namespace Utils { class FilePath; } namespace Autotest { -namespace Internal { -class TestParseResult; class TestConfiguration; +class TestParseResult; enum class TestRunMode; class TestTreeItem : public Utils::TypedTreeItem<TestTreeItem> @@ -170,8 +169,7 @@ public: typedef QVector<TestCodeLocationAndType> TestCodeLocationList; -} // namespace Internal } // namespace Autotest -Q_DECLARE_METATYPE(Autotest::Internal::TestTreeItem *) -Q_DECLARE_METATYPE(Autotest::Internal::TestCodeLocationAndType) +Q_DECLARE_METATYPE(Autotest::TestTreeItem *) +Q_DECLARE_METATYPE(Autotest::TestCodeLocationAndType) diff --git a/src/plugins/autotest/testtreemodel.cpp b/src/plugins/autotest/testtreemodel.cpp index 4f7f3524ce3..2715e0a5049 100644 --- a/src/plugins/autotest/testtreemodel.cpp +++ b/src/plugins/autotest/testtreemodel.cpp @@ -40,7 +40,8 @@ #include <utils/qtcassert.h> namespace Autotest { -namespace Internal { + +using namespace Internal; TestTreeModel::TestTreeModel(QObject *parent) : TreeModel<>(parent), @@ -720,5 +721,4 @@ bool TestTreeSortFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex } } -} // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testtreemodel.h b/src/plugins/autotest/testtreemodel.h index 18aac51d6bf..5b3a06e9e80 100644 --- a/src/plugins/autotest/testtreemodel.h +++ b/src/plugins/autotest/testtreemodel.h @@ -37,10 +37,10 @@ namespace Autotest { namespace Internal { - class TestCodeParser; -class TestParseResult; +} // namespace Internal +class TestParseResult; using TestParseResultPtr = QSharedPointer<TestParseResult>; class AUTOTESTSHARED_EXPORT TestTreeModel : public Utils::TreeModel<> @@ -53,7 +53,7 @@ public: bool setData(const QModelIndex &index, const QVariant &value, int role) override; Qt::ItemFlags flags(const QModelIndex &index) const override; - TestCodeParser *parser() const { return m_parser; } + Internal::TestCodeParser *parser() const { return m_parser; } bool hasTests() const; QList<TestConfiguration *> getAllTestCases() const; QList<TestConfiguration *> getSelectedTests() const; @@ -103,10 +103,12 @@ private: void syncFrameworks(const QList<Core::Id> &sortedIds); QList<TestTreeItem *> testItemsByName(TestTreeItem *root, const QString &testName); - TestCodeParser *m_parser; + Internal::TestCodeParser *m_parser = nullptr; QTimer m_syncFrameworksTimer; }; +namespace Internal { + class TestTreeSortFilterModel : public QSortFilterProxyModel { Q_OBJECT @@ -119,7 +121,7 @@ public: }; explicit TestTreeSortFilterModel(TestTreeModel *sourceModel, QObject *parent = nullptr); - void setSortMode(TestTreeItem::SortMode sortMode); + void setSortMode(Autotest::TestTreeItem::SortMode sortMode); void setFilterMode(FilterMode filterMode); void toggleFilter(FilterMode filterMode); static FilterMode toFilterMode(int f); @@ -129,7 +131,7 @@ protected: bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; private: - TestTreeItem::SortMode m_sortMode = TestTreeItem::Alphabetically; + Autotest::TestTreeItem::SortMode m_sortMode = Autotest::TestTreeItem::Alphabetically; FilterMode m_filterMode = Basic; }; |