diff options
author | Christian Stenger <[email protected]> | 2016-04-13 10:20:17 +0200 |
---|---|---|
committer | Christian Stenger <[email protected]> | 2016-05-12 13:49:00 +0000 |
commit | 87a6f003e9f8af599ae506afdd818350b5e24c4f (patch) | |
tree | e5efecc78683830bfb8ad9ede07446f16f09d833 /src/plugins/autotest/testresult.h | |
parent | b58a10dfff8751c954c448e5ea3741cf5bcca53b (diff) |
AutoTest: Split off TestResult...
...to avoid dragging around members that are not used in sub-classes.
Change-Id: I3e30b403491b1ae9219a0b461c3034cb854701a6
Reviewed-by: David Schulz <[email protected]>
Diffstat (limited to 'src/plugins/autotest/testresult.h')
-rw-r--r-- | src/plugins/autotest/testresult.h | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/src/plugins/autotest/testresult.h b/src/plugins/autotest/testresult.h index 86439b4640c..9b73e950022 100644 --- a/src/plugins/autotest/testresult.h +++ b/src/plugins/autotest/testresult.h @@ -67,25 +67,22 @@ enum Type { class TestResult { public: - TestResult(); - TestResult(const QString &className); + explicit TestResult(); + explicit TestResult(const QString &name); + virtual ~TestResult() {} - QString className() const { return m_class; } - QString testCase() const { return m_case; } - QString dataTag() const { return m_dataTag; } + virtual const QString outputString(bool selected) const; + + QString name() const { return m_name; } Result::Type result() const { return m_result; } QString description() const { return m_description; } QString fileName() const { return m_file; } int line() const { return m_line; } - TestType type() const { return m_type; } void setDescription(const QString &description) { m_description = description; } void setFileName(const QString &fileName) { m_file = fileName; } void setLine(int line) { m_line = line; } void setResult(Result::Type type) { m_result = type; } - void setTestCase(const QString &testCase) { m_case = testCase; } - void setDataTag(const QString &dataTag) { m_dataTag = dataTag; } - void setTestType(TestType type) { m_type = type; } static Result::Type resultFromString(const QString &resultString); static Result::Type toResultType(int rt); @@ -93,15 +90,11 @@ public: static QColor colorForType(const Result::Type type); private: - QString m_class; - QString m_case; - QString m_dataTag; - Result::Type m_result; + QString m_name; + Result::Type m_result = Result::Invalid; QString m_description; QString m_file; - int m_line; - TestType m_type; - // environment? + int m_line = 0; }; using TestResultPtr = QSharedPointer<TestResult>; @@ -115,16 +108,28 @@ public: class QTestResult : public TestResult { public: - QTestResult(const QString &className = QString()); + explicit QTestResult(const QString &className = QString()); + const QString outputString(bool selected) const override; + + void setFunctionName(const QString &functionName) { m_function = functionName; } + void setDataTag(const QString &dataTag) { m_dataTag = dataTag; } + +private: + QString m_function; + QString m_dataTag; }; class GTestResult : public TestResult { public: - GTestResult(const QString &className = QString()); -}; + explicit GTestResult(const QString &name = QString()); + const QString outputString(bool selected) const override; -bool operator==(const TestResult &t1, const TestResult &t2); + void setTestSetName(const QString &testSetName) { m_testSetName = testSetName; } + +private: + QString m_testSetName; +}; } // namespace Internal } // namespace Autotest |