Commit af81016e authored by Christian Stenger's avatar Christian Stenger

AutoTest: Rename 'AutoTest*' to reflect what it is

AutoTest* is too generic within the context where it is used.
This patch renames respective classes, members and string occurrences.

Change-Id: Ie413e4a344ddaf7892ecf248ba486defb4b9e3ef
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent 04a93c3b
......@@ -29,7 +29,7 @@ SOURCES += \
gtest/gtestresult.cpp \
gtest/gtestoutputreader.cpp \
gtest/gtestvisitors.cpp \
qtest/autotesttreeitem.cpp \
qtest/qttesttreeitem.cpp \
qtest/qttestvisitors.cpp \
qtest/qttestconfiguration.cpp \
qtest/qttestoutputreader.cpp \
......@@ -70,7 +70,7 @@ HEADERS += \
gtest/gtestresult.h \
gtest/gtest_utils.h \
gtest/gtestvisitors.h \
qtest/autotesttreeitem.h \
qtest/qttesttreeitem.h \
qtest/qttest_utils.h \
qtest/qttestresult.h \
qtest/qttestvisitors.h \
......
......@@ -24,7 +24,7 @@
****************************************************************************/
#include "qttestparser.h"
#include "autotesttreeitem.h"
#include "qttesttreeitem.h"
#include "qttestvisitors.h"
#include "qttest_utils.h"
#include "../autotest_utils.h"
......@@ -36,7 +36,7 @@ namespace Internal {
TestTreeItem *QtTestParseResult::createTestTreeItem() const
{
return itemType == TestTreeItem::Root ? 0 : AutoTestTreeItem::createTestItem(this);
return itemType == TestTreeItem::Root ? 0 : QtTestTreeItem::createTestItem(this);
}
static bool includesQtTest(const CPlusPlus::Document::Ptr &doc, const CPlusPlus::Snapshot &snapshot)
......
......@@ -23,7 +23,7 @@
**
****************************************************************************/
#include "autotesttreeitem.h"
#include "qttesttreeitem.h"
#include "qttestconfiguration.h"
#include "qttestparser.h"
#include "../autotest_utils.h"
......@@ -34,10 +34,10 @@
namespace Autotest {
namespace Internal {
AutoTestTreeItem *AutoTestTreeItem::createTestItem(const TestParseResult *result)
QtTestTreeItem *QtTestTreeItem::createTestItem(const TestParseResult *result)
{
AutoTestTreeItem *item = new AutoTestTreeItem(result->displayName, result->fileName,
result->itemType);
QtTestTreeItem *item = new QtTestTreeItem(result->displayName, result->fileName,
result->itemType);
item->setProFile(result->proFile);
item->setLine(result->line);
item->setColumn(result->column);
......@@ -47,7 +47,7 @@ AutoTestTreeItem *AutoTestTreeItem::createTestItem(const TestParseResult *result
return item;
}
QVariant AutoTestTreeItem::data(int column, int role) const
QVariant QtTestTreeItem::data(int column, int role) const
{
switch (role) {
case Qt::CheckStateRole:
......@@ -72,7 +72,7 @@ QVariant AutoTestTreeItem::data(int column, int role) const
return TestTreeItem::data(column, role);
}
bool AutoTestTreeItem::canProvideTestConfiguration() const
bool QtTestTreeItem::canProvideTestConfiguration() const
{
switch (type()) {
case TestCase:
......@@ -84,7 +84,7 @@ bool AutoTestTreeItem::canProvideTestConfiguration() const
}
}
TestConfiguration *AutoTestTreeItem::testConfiguration() const
TestConfiguration *QtTestTreeItem::testConfiguration() const
{
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
QTC_ASSERT(project, return 0);
......@@ -108,7 +108,7 @@ TestConfiguration *AutoTestTreeItem::testConfiguration() const
TestUtils::getCMakeDisplayNameIfNecessary(filePath(), parent->proFile()));
break;
}
case TestDataTag:{
case TestDataTag: {
const TestTreeItem *function = parentItem();
const TestTreeItem *parent = function ? function->parentItem() : 0;
if (!parent)
......@@ -128,7 +128,7 @@ TestConfiguration *AutoTestTreeItem::testConfiguration() const
return config;
}
QList<TestConfiguration *> AutoTestTreeItem::getAllTestConfigurations() const
QList<TestConfiguration *> QtTestTreeItem::getAllTestConfigurations() const
{
QList<TestConfiguration *> result;
......@@ -150,7 +150,7 @@ QList<TestConfiguration *> AutoTestTreeItem::getAllTestConfigurations() const
return result;
}
QList<TestConfiguration *> AutoTestTreeItem::getSelectedTestConfigurations() const
QList<TestConfiguration *> QtTestTreeItem::getSelectedTestConfigurations() const
{
QList<TestConfiguration *> result;
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
......@@ -197,7 +197,7 @@ QList<TestConfiguration *> AutoTestTreeItem::getSelectedTestConfigurations() con
return result;
}
TestTreeItem *AutoTestTreeItem::find(const TestParseResult *result)
TestTreeItem *QtTestTreeItem::find(const TestParseResult *result)
{
QTC_ASSERT(result, return 0);
......@@ -215,7 +215,7 @@ TestTreeItem *AutoTestTreeItem::find(const TestParseResult *result)
}
}
bool AutoTestTreeItem::modify(const TestParseResult *result)
bool QtTestTreeItem::modify(const TestParseResult *result)
{
QTC_ASSERT(result, return false);
......
......@@ -30,13 +30,13 @@
namespace Autotest {
namespace Internal {
class AutoTestTreeItem : public TestTreeItem
class QtTestTreeItem : public TestTreeItem
{
public:
AutoTestTreeItem(const QString &name = QString(), const QString &filePath = QString(),
Type type = Root) : TestTreeItem(name, filePath, type) {}
QtTestTreeItem(const QString &name = QString(), const QString &filePath = QString(),
Type type = Root) : TestTreeItem(name, filePath, type) {}
static AutoTestTreeItem *createTestItem(const TestParseResult *result);
static QtTestTreeItem *createTestItem(const TestParseResult *result);
QVariant data(int column, int role) const override;
bool canProvideTestConfiguration() const override;
......
......@@ -25,7 +25,7 @@
#pragma once
#include "autotesttreeitem.h"
#include "qttesttreeitem.h"
#include <cplusplus/ASTVisitor.h>
#include <cplusplus/CppDocument.h>
......
......@@ -31,7 +31,7 @@
#include "testtreemodel.h"
// FIXME
#include "qtest/autotesttreeitem.h"
#include "qtest/qttesttreeitem.h"
#include "quick/quicktesttreeitem.h"
#include "gtest/googletesttreeitem.h"
// end of FIXME
......@@ -48,13 +48,13 @@ namespace Internal {
TestTreeModel::TestTreeModel(QObject *parent) :
TreeModel(parent),
m_autoTestRootItem(new AutoTestTreeItem(tr("Auto Tests"), QString(), TestTreeItem::Root)),
m_qtTestRootItem(new QtTestTreeItem(tr("Qt Tests"), QString(), TestTreeItem::Root)),
m_quickTestRootItem(new QuickTestTreeItem(tr("Qt Quick Tests"), QString(), TestTreeItem::Root)),
m_googleTestRootItem(new GoogleTestTreeItem(tr("Google Tests"), QString(), TestTreeItem::Root)),
m_parser(new TestCodeParser(this)),
m_connectionsInitialized(false)
{
rootItem()->appendChild(m_autoTestRootItem);
rootItem()->appendChild(m_qtTestRootItem);
rootItem()->appendChild(m_quickTestRootItem);
rootItem()->appendChild(m_googleTestRootItem);
......@@ -171,7 +171,7 @@ Qt::ItemFlags TestTreeModel::flags(const QModelIndex &index) const
bool TestTreeModel::hasTests() const
{
return m_autoTestRootItem->childCount() > 0 || m_quickTestRootItem->childCount() > 0
return m_qtTestRootItem->childCount() > 0 || m_quickTestRootItem->childCount() > 0
|| m_googleTestRootItem->childCount() > 0;
}
......@@ -179,7 +179,7 @@ QList<TestConfiguration *> TestTreeModel::getAllTestCases() const
{
QList<TestConfiguration *> result;
result.append(m_autoTestRootItem->getAllTestConfigurations());
result.append(m_qtTestRootItem->getAllTestConfigurations());
result.append(m_quickTestRootItem->getAllTestConfigurations());
result.append(m_googleTestRootItem->getAllTestConfigurations());
return result;
......@@ -188,7 +188,7 @@ QList<TestConfiguration *> TestTreeModel::getAllTestCases() const
QList<TestConfiguration *> TestTreeModel::getSelectedTests() const
{
QList<TestConfiguration *> result;
result.append(m_autoTestRootItem->getSelectedTestConfigurations());
result.append(m_qtTestRootItem->getSelectedTestConfigurations());
result.append(m_quickTestRootItem->getSelectedTestConfigurations());
result.append(m_googleTestRootItem->getSelectedTestConfigurations());
return result;
......@@ -227,7 +227,7 @@ void TestTreeModel::removeFiles(const QStringList &files)
void TestTreeModel::markAllForRemoval()
{
foreach (Utils::TreeItem *item, m_autoTestRootItem->children())
foreach (Utils::TreeItem *item, m_qtTestRootItem->children())
static_cast<TestTreeItem *>(item)->markForRemovalRecursively(true);
foreach (Utils::TreeItem *item, m_quickTestRootItem->children())
......@@ -270,11 +270,11 @@ void TestTreeModel::sweep()
QHash<QString, QString> TestTreeModel::testCaseNamesForFiles(QStringList files)
{
QHash<QString, QString> result;
if (!m_autoTestRootItem)
if (!m_qtTestRootItem)
return result;
for (int row = 0, count = m_autoTestRootItem->childCount(); row < count; ++row) {
const TestTreeItem *child = m_autoTestRootItem->childItem(row);
for (int row = 0, count = m_qtTestRootItem->childCount(); row < count; ++row) {
const TestTreeItem *child = m_qtTestRootItem->childItem(row);
if (files.contains(child->filePath())) {
result.insert(child->filePath(), child->name());
}
......@@ -346,7 +346,7 @@ void TestTreeModel::handleParseResult(const TestParseResult *result, TestTreeIte
void TestTreeModel::removeAllTestItems()
{
m_autoTestRootItem->removeChildren();
m_qtTestRootItem->removeChildren();
m_quickTestRootItem->removeChildren();
m_googleTestRootItem->removeChildren();
emit testTreeModelChanged();
......@@ -356,7 +356,7 @@ TestTreeItem *TestTreeModel::rootItemForType(TestTreeModel::Type type)
{
switch (type) {
case AutoTest:
return m_autoTestRootItem;
return m_qtTestRootItem;
case QuickTest:
return m_quickTestRootItem;
case GoogleTest:
......@@ -370,7 +370,7 @@ TestTreeItem *TestTreeModel::rootItemForType(TestTreeModel::Type type)
#ifdef WITH_TESTS
int TestTreeModel::autoTestsCount() const
{
return m_autoTestRootItem ? m_autoTestRootItem->childCount() : 0;
return m_qtTestRootItem ? m_qtTestRootItem->childCount() : 0;
}
int TestTreeModel::namedQuickTestsCount() const
......@@ -390,7 +390,7 @@ int TestTreeModel::unnamedQuickTestsCount() const
int TestTreeModel::dataTagsCount() const
{
int dataTagCount = 0;
foreach (Utils::TreeItem *item, m_autoTestRootItem->children()) {
foreach (Utils::TreeItem *item, m_qtTestRootItem->children()) {
TestTreeItem *classItem = static_cast<TestTreeItem *>(item);
foreach (Utils::TreeItem *functionItem, classItem->children())
dataTagCount += functionItem->childCount();
......
......@@ -104,7 +104,7 @@ private:
void setupParsingConnections();
// FIXME
TestTreeItem *m_autoTestRootItem;
TestTreeItem *m_qtTestRootItem;
TestTreeItem *m_quickTestRootItem;
TestTreeItem *m_googleTestRootItem;
// end of FIXME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment