Commit 0faf4994 authored by Christian Stenger's avatar Christian Stenger

AutoTest: Separate different test code parsers.

Change-Id: I7ff68be6e5442f7140d1257c7d9057434a398359
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent 5f00b16f
This diff is collapsed.
......@@ -40,6 +40,10 @@ namespace Core {
class Id;
}
namespace CppTools {
class CppModelManager;
}
namespace Autotest {
namespace Internal {
......@@ -88,6 +92,53 @@ public:
using TestParseResultPtr = QSharedPointer<TestParseResult>;
class ITestParser
{
public:
virtual ~ITestParser() { }
virtual void init(const QStringList &filesToParse) = 0;
virtual bool processDocument(QFutureInterface<TestParseResultPtr> futureInterface,
const QString &fileName) = 0;
};
class CppParser : public ITestParser
{
public:
void init(const QStringList &filesToParse) override;
static bool selectedForBuilding(const QString &fileName);
protected:
CPlusPlus::Snapshot m_cppSnapshot;
};
class QtTestParser : public CppParser
{
public:
void init(const QStringList &filesToParse) override;
bool processDocument(QFutureInterface<TestParseResultPtr> futureInterface,
const QString &fileName) override;
private:
QHash<QString, QString> m_testCaseNames;
};
class QuickTestParser : public CppParser
{
public:
void init(const QStringList &filesToParse) override;
bool processDocument(QFutureInterface<TestParseResultPtr> futureInterface,
const QString &fileName) override;
private:
QmlJS::Snapshot m_qmlSnapshot;
};
class GoogleTestParser : public CppParser
{
public:
bool processDocument(QFutureInterface<TestParseResultPtr> futureInterface,
const QString &fileName) override;
};
class TestCodeParser : public QObject
{
Q_OBJECT
......@@ -144,6 +195,7 @@ private:
QSet<QString> m_postponedFiles;
State m_parserState;
QFutureWatcher<TestParseResultPtr> m_futureWatcher;
QVector<ITestParser *> m_testCodeParsers;
};
} // namespace Internal
......
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