Commit 5a3a879a authored by Christian Stenger's avatar Christian Stenger

AutoTest: Unify naming scheme for gtest related classes and files

Change-Id: Ib0739889cbc6416da3f28f1e39b197317ec8a4e6
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent af81016e
......@@ -23,9 +23,9 @@ SOURCES += \
testsettingspage.cpp \
testnavigationwidget.cpp \
testoutputreader.cpp \
gtest/googletestconfiguration.cpp \
gtest/googletestparser.cpp \
gtest/googletesttreeitem.cpp \
gtest/gtestconfiguration.cpp \
gtest/gtestparser.cpp \
gtest/gtesttreeitem.cpp \
gtest/gtestresult.cpp \
gtest/gtestoutputreader.cpp \
gtest/gtestvisitors.cpp \
......@@ -63,9 +63,9 @@ HEADERS += \
testoutputreader.h \
autotesticons.h \
itestparser.h \
gtest/googletestconfiguration.h \
gtest/googletestparser.h \
gtest/googletesttreeitem.h \
gtest/gtestconfiguration.h \
gtest/gtestparser.h \
gtest/gtesttreeitem.h \
gtest/gtestoutputreader.h \
gtest/gtestresult.h \
gtest/gtest_utils.h \
......
......@@ -23,20 +23,20 @@
**
****************************************************************************/
#include "googletestconfiguration.h"
#include "gtestconfiguration.h"
#include "gtestoutputreader.h"
#include "../testsettings.h"
namespace Autotest {
namespace Internal {
TestOutputReader *GoogleTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
QProcess *app) const
TestOutputReader *GTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
QProcess *app) const
{
return new GTestOutputReader(fi, app, buildDirectory());
}
QStringList GoogleTestConfiguration::argumentsForTestRunner(const TestSettings &settings) const
QStringList GTestConfiguration::argumentsForTestRunner(const TestSettings &settings) const
{
QStringList arguments;
const QStringList &testSets = testCases();
......
......@@ -30,10 +30,10 @@
namespace Autotest {
namespace Internal {
class GoogleTestConfiguration : public TestConfiguration
class GTestConfiguration : public TestConfiguration
{
public:
explicit GoogleTestConfiguration() {}
explicit GTestConfiguration() {}
TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
QProcess *app) const override;
QStringList argumentsForTestRunner(const TestSettings &settings) const override;
......
......@@ -23,8 +23,8 @@
**
****************************************************************************/
#include "googletestparser.h"
#include "googletesttreeitem.h"
#include "gtestparser.h"
#include "gtesttreeitem.h"
#include "gtestvisitors.h"
#include "gtest_utils.h"
#include "../autotest_utils.h"
......@@ -32,10 +32,10 @@
namespace Autotest {
namespace Internal {
TestTreeItem *GoogleTestParseResult::createTestTreeItem() const
TestTreeItem *GTestParseResult::createTestTreeItem() const
{
if (itemType == TestTreeItem::TestCase || itemType == TestTreeItem::TestFunctionOrSet)
return GoogleTestTreeItem::createTestItem(this);
return GTestTreeItem::createTestItem(this);
return 0;
}
......@@ -91,7 +91,7 @@ static bool handleGTest(QFutureInterface<TestParseResultPtr> futureInterface,
proFile = ppList.first()->projectFile;
foreach (const GTestCaseSpec &testSpec, result.keys()) {
GoogleTestParseResult *parseResult = new GoogleTestParseResult;
GTestParseResult *parseResult = new GTestParseResult;
parseResult->itemType = TestTreeItem::TestCase;
parseResult->fileName = filePath;
parseResult->name = testSpec.testCaseName;
......@@ -101,12 +101,12 @@ static bool handleGTest(QFutureInterface<TestParseResultPtr> futureInterface,
parseResult->proFile = proFile;
foreach (const GTestCodeLocationAndType &location, result.value(testSpec)) {
GoogleTestParseResult *testSet = new GoogleTestParseResult;
GTestParseResult *testSet = new GTestParseResult;
testSet->name = location.m_name;
testSet->fileName = filePath;
testSet->line = location.m_line;
testSet->column = location.m_column;
testSet->disabled = location.m_state & GoogleTestTreeItem::Disabled;
testSet->disabled = location.m_state & GTestTreeItem::Disabled;
testSet->itemType = location.m_type;
testSet->proFile = proFile;
......@@ -118,8 +118,8 @@ static bool handleGTest(QFutureInterface<TestParseResultPtr> futureInterface,
return !result.keys().isEmpty();
}
bool GoogleTestParser::processDocument(QFutureInterface<TestParseResultPtr> futureInterface,
const QString &fileName)
bool GTestParser::processDocument(QFutureInterface<TestParseResultPtr> futureInterface,
const QString &fileName)
{
if (!m_cppSnapshot.contains(fileName) || !selectedForBuilding(fileName))
return false;
......
......@@ -30,17 +30,17 @@
namespace Autotest {
namespace Internal {
class GoogleTestParseResult : public TestParseResult
class GTestParseResult : public TestParseResult
{
public:
explicit GoogleTestParseResult() : TestParseResult(TestTreeModel::GoogleTest) {}
explicit GTestParseResult() : TestParseResult(TestTreeModel::GoogleTest) {}
TestTreeItem *createTestTreeItem() const override;
bool parameterized = false;
bool typed = false;
bool disabled = false;
};
class GoogleTestParser : public CppParser
class GTestParser : public CppParser
{
public:
bool processDocument(QFutureInterface<TestParseResultPtr> futureInterface,
......
......@@ -30,9 +30,9 @@
namespace Autotest {
namespace Internal {
class GoogleTestParseResult;
class GTestParseResult;
class GoogleTestTreeItem : public TestTreeItem
class GTestTreeItem : public TestTreeItem
{
public:
enum TestState
......@@ -46,10 +46,10 @@ public:
Q_FLAGS(TestState)
Q_DECLARE_FLAGS(TestStates, TestState)
GoogleTestTreeItem(const QString &name = QString(), const QString &filePath = QString(),
Type type = Root) : TestTreeItem(name, filePath, type), m_state(Enabled) {}
GTestTreeItem(const QString &name = QString(), const QString &filePath = QString(),
Type type = Root) : TestTreeItem(name, filePath, type), m_state(Enabled) {}
static GoogleTestTreeItem *createTestItem(const TestParseResult *result);
static GTestTreeItem *createTestItem(const TestParseResult *result);
QVariant data(int column, int role) const override;
bool canProvideTestConfiguration() const override { return type() != Root; }
......@@ -62,20 +62,20 @@ public:
void setStates(TestStates states) { m_state = states; }
void setState(TestState state) { m_state |= state; }
TestStates state() const { return m_state; }
bool modifyTestSetContent(const GoogleTestParseResult *result);
bool modifyTestSetContent(const GTestParseResult *result);
TestTreeItem *findChildByNameStateAndFile(const QString &name,
GoogleTestTreeItem::TestStates state,
GTestTreeItem::TestStates state,
const QString &proFile) const;
QString nameSuffix() const;
private:
GoogleTestTreeItem::TestStates m_state;
GTestTreeItem::TestStates m_state;
};
class GTestCodeLocationAndType : public TestCodeLocationAndType
{
public:
GoogleTestTreeItem::TestStates m_state;
GTestTreeItem::TestStates m_state;
};
typedef QVector<GTestCodeLocationAndType> GTestCodeLocationList;
......
......@@ -70,8 +70,8 @@ bool GTestVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
locationAndType.m_line = line;
locationAndType.m_column = column - 1;
locationAndType.m_type = TestTreeItem::TestFunctionOrSet;
locationAndType.m_state = disabled ? GoogleTestTreeItem::Disabled
: GoogleTestTreeItem::Enabled;
locationAndType.m_state = disabled ? GTestTreeItem::Disabled
: GTestTreeItem::Enabled;
GTestCaseSpec spec;
spec.testCaseName = testCaseName;
spec.parameterized = GTestUtils::isGTestParameterized(prettyName);
......
......@@ -25,7 +25,7 @@
#pragma once
#include "googletesttreeitem.h"
#include "gtesttreeitem.h"
#include <cplusplus/ASTVisitor.h>
#include <cplusplus/CppDocument.h>
......
......@@ -30,7 +30,7 @@
// FIXME
#include "qtest/qttestparser.h"
#include "quick/quicktestparser.h"
#include "gtest/googletestparser.h"
#include "gtest/gtestparser.h"
// end of FIXME
#include <coreplugin/editormanager/editormanager.h>
......@@ -84,7 +84,7 @@ TestCodeParser::TestCodeParser(TestTreeModel *parent)
m_testCodeParsers.append(new QtTestParser);
m_testCodeParsers.append(new QuickTestParser);
m_testCodeParsers.append(new GoogleTestParser);
m_testCodeParsers.append(new GTestParser);
}
TestCodeParser::~TestCodeParser()
......
......@@ -33,7 +33,7 @@
// FIXME
#include "qtest/qttesttreeitem.h"
#include "quick/quicktesttreeitem.h"
#include "gtest/googletesttreeitem.h"
#include "gtest/gtesttreeitem.h"
// end of FIXME
#include <cpptools/cppmodelmanager.h>
......@@ -50,7 +50,7 @@ TestTreeModel::TestTreeModel(QObject *parent) :
TreeModel(parent),
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_googleTestRootItem(new GTestTreeItem(tr("Google Tests"), QString(), TestTreeItem::Root)),
m_parser(new TestCodeParser(this)),
m_connectionsInitialized(false)
{
......
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