Autotest: Keep track of generating framework in TestTreeItem

... and TestConfiguration. This allows dropping code that
reconstruct framework ids and framework lookup by id.

Change-Id: I0bb1e6e135376e21f96b9fab7971aa097787e483
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2020-03-26 10:11:39 +01:00
parent 223281222d
commit 77c4caf4ea
36 changed files with 117 additions and 106 deletions

View File

@@ -45,6 +45,7 @@ namespace Internal {
class TestRunConfiguration;
} // namespace Internal
class ITestFramework;
class TestOutputReader;
class TestResult;
enum class TestRunMode;
@@ -54,7 +55,7 @@ using TestResultPtr = QSharedPointer<TestResult>;
class TestConfiguration
{
public:
explicit TestConfiguration() = default;
explicit TestConfiguration(ITestFramework *framework);
virtual ~TestConfiguration();
void completeTestInformation(TestRunMode runMode);
@@ -73,6 +74,7 @@ public:
void setInternalTargets(const QSet<QString> &targets);
void setOriginalRunConfiguration(ProjectExplorer::RunConfiguration *runConfig);
ITestFramework *framework() const;
QStringList testCases() const { return m_testCases; }
int testCaseCount() const { return m_testCaseCount; }
QString executableFilePath() const;
@@ -95,7 +97,9 @@ public:
QProcess *app) const = 0;
virtual QStringList argumentsForTestRunner(QStringList *omitted = nullptr) const = 0;
virtual Utils::Environment filteredEnvironment(const Utils::Environment &original) const = 0;
private:
ITestFramework *m_framework;
QStringList m_testCases;
int m_testCaseCount = 0;
QString m_projectFile;
@@ -113,8 +117,8 @@ private:
class DebuggableTestConfiguration : public TestConfiguration
{
public:
explicit DebuggableTestConfiguration(TestRunMode runMode = TestRunMode::Run)
: m_runMode(runMode) {}
explicit DebuggableTestConfiguration(ITestFramework *framework, TestRunMode runMode = TestRunMode::Run)
: TestConfiguration(framework), m_runMode(runMode) {}
void setRunMode(TestRunMode mode) { m_runMode = mode; }
TestRunMode runMode() const { return m_runMode; }