forked from qt-creator/qt-creator
TestResult: Devirtualize the class - part 1 of 5
The goal is to make the TestResult a value type without a need to create these objects on heap. Introduce a ResultHooks class that will replace all 5 virtual methods. Step 1 - implement outputStringHook. Reorder constructor arguments of TestResult's subclasses so that the first 2 args are always: id and name. Change-Id: Iae93e5a348328414f057d1471afad8020b3c1171 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -13,19 +13,17 @@ class BoostTestTreeItem;
|
||||
class BoostTestResult : public TestResult
|
||||
{
|
||||
public:
|
||||
BoostTestResult(const QString &id, const Utils::FilePath &projectFile, const QString &name);
|
||||
const QString outputString(bool selected) const override;
|
||||
BoostTestResult(const QString &id, const QString &name, const Utils::FilePath &projectFile,
|
||||
const QString &testCaseName = {}, const QString &testSuiteName = {});
|
||||
|
||||
bool isDirectParentOf(const TestResult *other, bool *needsIntermediate) const override;
|
||||
const ITestTreeItem * findTestTreeItem() const override;
|
||||
void setTestSuite(const QString &testSuite) { m_testSuite = testSuite; }
|
||||
void setTestCase(const QString &testCase) { m_testCase = testCase; }
|
||||
private:
|
||||
bool matches(const BoostTestTreeItem *item) const;
|
||||
|
||||
Utils::FilePath m_projectFile;
|
||||
QString m_testSuite;
|
||||
QString m_testCase;
|
||||
QString m_testCaseName;
|
||||
QString m_testSuiteName;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user