AutoTest: Split off TestParseResult...

...to allow different approaches for different test frameworks.

Change-Id: I16f101fb3f702a0db00cffe33e0d83cd4ea28c99
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Christian Stenger
2016-04-11 14:50:04 +02:00
committed by Christian Stenger
parent db71490b1e
commit b58a10dfff
6 changed files with 151 additions and 103 deletions

View File

@@ -43,8 +43,46 @@ class Id;
namespace Autotest {
namespace Internal {
struct TestCodeLocationAndType;
struct GTestCaseSpec;
class TestParseResult
{
public:
explicit TestParseResult(TestTreeModel::Type t = TestTreeModel::Invalid) : type(t) {}
virtual ~TestParseResult() {}
TestTreeModel::Type type;
QString fileName;
QString proFile;
QString testCaseName;
unsigned line = 0;
unsigned column = 0;
};
class QtTestParseResult : public TestParseResult
{
public:
QtTestParseResult(TestTreeModel::Type t = TestTreeModel::Invalid) : TestParseResult(t) {}
QMap<QString, TestCodeLocationAndType> functions;
QMap<QString, TestCodeLocationList> dataTags;
};
class QuickTestParseResult : public TestParseResult
{
public:
QuickTestParseResult(TestTreeModel::Type t = TestTreeModel::Invalid) : TestParseResult(t) {}
QMap<QString, TestCodeLocationAndType> functions;
};
class GoogleTestParseResult : public TestParseResult
{
public:
GoogleTestParseResult(TestTreeModel::Type t = TestTreeModel::Invalid) : TestParseResult(t) {}
bool parameterized = false;
bool typed = false;
bool disabled = false;
TestCodeLocationList testSets;
};
using TestParseResultPtr = QSharedPointer<TestParseResult>;
class TestCodeParser : public QObject
{
@@ -106,3 +144,5 @@ private:
} // namespace Internal
} // Autotest
Q_DECLARE_METATYPE(Autotest::Internal::TestParseResultPtr)