forked from qt-creator/qt-creator
AutoTest: Provide DebuggableTestConfiguration
Preparation for easier distinguishing arguments for performing normal run versus debug run. Change-Id: I41cfa7fca5730f721b5b6a980c82c015f9e7f914 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class GTestConfiguration : public TestConfiguration
|
class GTestConfiguration : public DebuggableTestConfiguration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit GTestConfiguration() {}
|
explicit GTestConfiguration() {}
|
||||||
|
|||||||
@@ -135,7 +135,10 @@ TestConfiguration *GTestTreeItem::testConfiguration() const
|
|||||||
|
|
||||||
TestConfiguration *GTestTreeItem::debugConfiguration() const
|
TestConfiguration *GTestTreeItem::debugConfiguration() const
|
||||||
{
|
{
|
||||||
return testConfiguration();
|
GTestConfiguration *config = static_cast<GTestConfiguration *>(testConfiguration());
|
||||||
|
if (config)
|
||||||
|
config->setRunMode(DebuggableTestConfiguration::Debug);
|
||||||
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
// used as key inside getAllTestCases()/getSelectedTestCases() for Google Tests
|
// used as key inside getAllTestCases()/getSelectedTestCases() for Google Tests
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QtTestConfiguration : public TestConfiguration
|
class QtTestConfiguration : public DebuggableTestConfiguration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QtTestConfiguration() {}
|
explicit QtTestConfiguration() {}
|
||||||
|
|||||||
@@ -136,6 +136,8 @@ TestConfiguration *QtTestTreeItem::testConfiguration() const
|
|||||||
TestConfiguration *QtTestTreeItem::debugConfiguration() const
|
TestConfiguration *QtTestTreeItem::debugConfiguration() const
|
||||||
{
|
{
|
||||||
QtTestConfiguration *config = static_cast<QtTestConfiguration *>(testConfiguration());
|
QtTestConfiguration *config = static_cast<QtTestConfiguration *>(testConfiguration());
|
||||||
|
if (config)
|
||||||
|
config->setRunMode(DebuggableTestConfiguration::Debug);
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,5 +103,25 @@ private:
|
|||||||
TestRunConfiguration *m_runConfig = 0;
|
TestRunConfiguration *m_runConfig = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class DebuggableTestConfiguration : public TestConfiguration
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum RunMode
|
||||||
|
{
|
||||||
|
Run,
|
||||||
|
Debug
|
||||||
|
};
|
||||||
|
|
||||||
|
explicit DebuggableTestConfiguration(RunMode runMode = Run) : m_runMode(runMode) {}
|
||||||
|
~DebuggableTestConfiguration() {}
|
||||||
|
|
||||||
|
void setRunMode(RunMode mode) { m_runMode = mode; }
|
||||||
|
RunMode runMode() const { return m_runMode; }
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
RunMode m_runMode;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Autotest
|
} // namespace Autotest
|
||||||
|
|||||||
Reference in New Issue
Block a user