forked from qt-creator/qt-creator
AutoTest: Introduce ITestBase
Make ITestBase the base class for ITestFramework. Preparation for adding support for testing tools. Change-Id: If9184dcbd94c10b17bba83c0d02b0ecb50458e67 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -28,16 +28,11 @@
|
||||
|
||||
namespace Autotest {
|
||||
|
||||
ITestFramework::ITestFramework(bool activeByDefault)
|
||||
ITestBase::ITestBase(bool activeByDefault)
|
||||
: m_active(activeByDefault)
|
||||
{}
|
||||
|
||||
ITestFramework::~ITestFramework()
|
||||
{
|
||||
delete m_testParser;
|
||||
}
|
||||
|
||||
TestTreeItem *ITestFramework::rootNode()
|
||||
TestTreeItem *ITestBase::rootNode()
|
||||
{
|
||||
if (!m_rootNode)
|
||||
m_rootNode = createRootNode();
|
||||
@@ -45,25 +40,18 @@ TestTreeItem *ITestFramework::rootNode()
|
||||
return m_rootNode;
|
||||
}
|
||||
|
||||
ITestParser *ITestFramework::testParser()
|
||||
{
|
||||
if (!m_testParser)
|
||||
m_testParser = createTestParser();
|
||||
return m_testParser;
|
||||
}
|
||||
|
||||
Utils::Id ITestFramework::settingsId() const
|
||||
Utils::Id ITestBase::settingsId() const
|
||||
{
|
||||
return Utils::Id(Constants::SETTINGSPAGE_PREFIX)
|
||||
.withSuffix(QString("%1.%2").arg(priority()).arg(QLatin1String(name())));
|
||||
}
|
||||
|
||||
Utils::Id ITestFramework::id() const
|
||||
Utils::Id ITestBase::id() const
|
||||
{
|
||||
return Utils::Id(Constants::FRAMEWORK_PREFIX).withSuffix(name());
|
||||
}
|
||||
|
||||
void ITestFramework::resetRootNode()
|
||||
void ITestBase::resetRootNode()
|
||||
{
|
||||
if (!m_rootNode)
|
||||
return;
|
||||
@@ -73,4 +61,21 @@ void ITestFramework::resetRootNode()
|
||||
m_rootNode = nullptr;
|
||||
}
|
||||
|
||||
|
||||
ITestFramework::ITestFramework(bool activeByDefault)
|
||||
: ITestBase(activeByDefault)
|
||||
{}
|
||||
|
||||
ITestFramework::~ITestFramework()
|
||||
{
|
||||
delete m_testParser;
|
||||
}
|
||||
|
||||
ITestParser *ITestFramework::testParser()
|
||||
{
|
||||
if (!m_testParser)
|
||||
m_testParser = createTestParser();
|
||||
return m_testParser;
|
||||
}
|
||||
|
||||
} // namespace Autotest
|
||||
|
||||
Reference in New Issue
Block a user