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