forked from qt-creator/qt-creator
AutoTest: Enable debugging for Quick Tests
Task-number: QTCREATORBUG-18961 Change-Id: I6f00c84ea6279ceb59745e5bb12349511ae4637b Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -81,10 +81,8 @@ QStringList QtTestConfiguration::argumentsForTestRunner(QStringList *omitted) co
|
|||||||
if (qtSettings->logSignalsSlots)
|
if (qtSettings->logSignalsSlots)
|
||||||
arguments << "-vs";
|
arguments << "-vs";
|
||||||
|
|
||||||
if (isDebugRunMode()) {
|
if (isDebugRunMode() && qtSettings->noCrashHandler)
|
||||||
if (qtSettings->noCrashHandler)
|
arguments << "-nocrashhandler";
|
||||||
arguments << "-nocrashhandler";
|
|
||||||
}
|
|
||||||
|
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,11 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
QuickTestConfiguration::QuickTestConfiguration()
|
||||||
|
{
|
||||||
|
setMixedDebugging(true);
|
||||||
|
}
|
||||||
|
|
||||||
TestOutputReader *QuickTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
TestOutputReader *QuickTestConfiguration::outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
QProcess *app) const
|
QProcess *app) const
|
||||||
{
|
{
|
||||||
@@ -74,6 +79,11 @@ QStringList QuickTestConfiguration::argumentsForTestRunner(QStringList *omitted)
|
|||||||
const QString &metricsOption = QtTestSettings::metricsTypeToOption(qtSettings->metrics);
|
const QString &metricsOption = QtTestSettings::metricsTypeToOption(qtSettings->metrics);
|
||||||
if (!metricsOption.isEmpty())
|
if (!metricsOption.isEmpty())
|
||||||
arguments << metricsOption;
|
arguments << metricsOption;
|
||||||
|
|
||||||
|
if (isDebugRunMode()) {
|
||||||
|
if (qtSettings->noCrashHandler)
|
||||||
|
arguments << "-nocrashhandler";
|
||||||
|
}
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,10 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QuickTestConfiguration : public TestConfiguration
|
class QuickTestConfiguration : public DebuggableTestConfiguration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit QuickTestConfiguration() {}
|
QuickTestConfiguration();
|
||||||
TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
TestOutputReader *outputReader(const QFutureInterface<TestResultPtr> &fi,
|
||||||
QProcess *app) const override;
|
QProcess *app) const override;
|
||||||
QStringList argumentsForTestRunner(QStringList *omitted = nullptr) const override;
|
QStringList argumentsForTestRunner(QStringList *omitted = nullptr) const override;
|
||||||
|
|||||||
@@ -109,6 +109,11 @@ bool QuickTestTreeItem::canProvideTestConfiguration() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QuickTestTreeItem::canProvideDebugConfiguration() const
|
||||||
|
{
|
||||||
|
return canProvideTestConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
TestConfiguration *QuickTestTreeItem::testConfiguration() const
|
TestConfiguration *QuickTestTreeItem::testConfiguration() const
|
||||||
{
|
{
|
||||||
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||||
@@ -143,6 +148,14 @@ TestConfiguration *QuickTestTreeItem::testConfiguration() const
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TestConfiguration *QuickTestTreeItem::debugConfiguration() const
|
||||||
|
{
|
||||||
|
QuickTestConfiguration *config = static_cast<QuickTestConfiguration *>(testConfiguration());
|
||||||
|
if (config)
|
||||||
|
config->setRunMode(TestRunMode::Debug);
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
QList<TestConfiguration *> QuickTestTreeItem::getAllTestConfigurations() const
|
QList<TestConfiguration *> QuickTestTreeItem::getAllTestConfigurations() const
|
||||||
{
|
{
|
||||||
QList<TestConfiguration *> result;
|
QList<TestConfiguration *> result;
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ public:
|
|||||||
QVariant data(int column, int role) const override;
|
QVariant data(int column, int role) const override;
|
||||||
Qt::ItemFlags flags(int column) const override;
|
Qt::ItemFlags flags(int column) const override;
|
||||||
bool canProvideTestConfiguration() const override;
|
bool canProvideTestConfiguration() const override;
|
||||||
|
bool canProvideDebugConfiguration() const override;
|
||||||
TestConfiguration *testConfiguration() const override;
|
TestConfiguration *testConfiguration() const override;
|
||||||
|
TestConfiguration *debugConfiguration() const override;
|
||||||
QList<TestConfiguration *> getAllTestConfigurations() const override;
|
QList<TestConfiguration *> getAllTestConfigurations() const override;
|
||||||
QList<TestConfiguration *> getSelectedTestConfigurations() const override;
|
QList<TestConfiguration *> getSelectedTestConfigurations() const override;
|
||||||
TestTreeItem *find(const TestParseResult *result) override;
|
TestTreeItem *find(const TestParseResult *result) override;
|
||||||
|
|||||||
@@ -117,8 +117,11 @@ public:
|
|||||||
void setRunMode(TestRunMode mode) { m_runMode = mode; }
|
void setRunMode(TestRunMode mode) { m_runMode = mode; }
|
||||||
TestRunMode runMode() const { return m_runMode; }
|
TestRunMode runMode() const { return m_runMode; }
|
||||||
bool isDebugRunMode() const;
|
bool isDebugRunMode() const;
|
||||||
|
void setMixedDebugging(bool enable) { m_mixedDebugging = enable; }
|
||||||
|
bool mixedDebugging() const { return m_mixedDebugging; }
|
||||||
private:
|
private:
|
||||||
TestRunMode m_runMode;
|
TestRunMode m_runMode;
|
||||||
|
bool m_mixedDebugging = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -52,10 +52,12 @@ public:
|
|||||||
initialize("AutoTest.TestRunConfig");
|
initialize("AutoTest.TestRunConfig");
|
||||||
setDefaultDisplayName(tr("AutoTest Debug"));
|
setDefaultDisplayName(tr("AutoTest Debug"));
|
||||||
|
|
||||||
// disable QmlDebugger that is enabled by default
|
bool enableQuick = false;
|
||||||
// might change if debugging QuickTest gets enabled
|
if (auto debuggable = dynamic_cast<DebuggableTestConfiguration *>(config))
|
||||||
|
enableQuick = debuggable->mixedDebugging();
|
||||||
|
|
||||||
if (auto debugAspect = extraAspect<Debugger::DebuggerRunConfigurationAspect>())
|
if (auto debugAspect = extraAspect<Debugger::DebuggerRunConfigurationAspect>())
|
||||||
debugAspect->setUseQmlDebugger(false);
|
debugAspect->setUseQmlDebugger(enableQuick);
|
||||||
m_testConfig = config;
|
m_testConfig = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user