AutoTest: Introduce ITestTool

Preparation for separating handling of code based and
build system based tests.

Task-number: QTCREATORBUG-23332
Change-Id: I490af5f3157fd4a8cd07d976cdfd9e4503ade97b
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-10-19 13:56:19 +02:00
parent e95041c054
commit 73613d8549
23 changed files with 134 additions and 71 deletions

View File

@@ -27,10 +27,15 @@
#include <utils/id.h>
namespace ProjectExplorer { struct TestCaseInfo; }
namespace Autotest {
class ITestFramework;
class ITestParser;
class ITestSettings;
class ITestTool;
class ITestTreeItem;
class TestTreeItem;
class ITestBase
@@ -44,8 +49,6 @@ public:
virtual ITestSettings *testSettings() { return nullptr; }
TestTreeItem *rootNode();
Utils::Id settingsId() const;
Utils::Id id() const;
@@ -54,12 +57,18 @@ public:
void resetRootNode();
virtual ITestFramework *asFramework() { return nullptr; }
virtual ITestTool *asTestTool() { return nullptr; }
protected:
virtual TestTreeItem *createRootNode() = 0;
virtual ITestTreeItem *createRootNode() = 0;
private:
TestTreeItem *m_rootNode = nullptr;
ITestTreeItem *m_rootNode = nullptr;
bool m_active = false;
friend class ITestFramework;
friend class ITestTool;
};
class ITestFramework : public ITestBase
@@ -68,6 +77,7 @@ public:
explicit ITestFramework(bool activeByDefault);
~ITestFramework() override;
TestTreeItem *rootNode();
ITestParser *testParser();
bool grouping() const { return m_grouping; }
@@ -75,6 +85,8 @@ public:
// framework specific tool tip to be displayed on the general settings page
virtual QString groupingToolTip() const { return QString(); }
ITestFramework *asFramework() final { return this; }
protected:
virtual ITestParser *createTestParser() = 0;
@@ -85,4 +97,23 @@ private:
using TestFrameworks = QList<ITestFramework *>;
class ITestTool : public ITestBase
{
public:
explicit ITestTool(bool activeByDefault) : ITestBase(activeByDefault) {}
ITestTreeItem *rootNode();
virtual Utils::Id buildSystemId() const = 0;
virtual ITestTreeItem *createItemFromTestCaseInfo(const ProjectExplorer::TestCaseInfo &tci) = 0;
ITestTool *asTestTool() final { return this; }
private:
unsigned priority() const final { return 255; }
};
using TestTools = QList<ITestTool *>;
} // namespace Autotest