2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2016-06-15 12:29:24 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2016-06-23 07:34:53 +02:00
|
|
|
#include "testconfiguration.h"
|
|
|
|
|
|
2018-07-11 15:44:51 +02:00
|
|
|
#include <debugger/debuggerrunconfigurationaspect.h>
|
2018-09-11 14:40:57 +02:00
|
|
|
|
2020-10-09 13:07:55 +02:00
|
|
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
2018-09-11 14:40:57 +02:00
|
|
|
#include <projectexplorer/projectexplorer.h>
|
2016-06-23 07:34:53 +02:00
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
2016-06-15 12:29:24 +02:00
|
|
|
#include <projectexplorer/runconfiguration.h>
|
2018-09-11 14:40:57 +02:00
|
|
|
|
2016-06-23 07:34:53 +02:00
|
|
|
#include <utils/qtcassert.h>
|
2016-06-15 12:29:24 +02:00
|
|
|
|
2023-02-08 11:15:14 +01:00
|
|
|
#include <QCoreApplication>
|
|
|
|
|
|
2016-06-15 12:29:24 +02:00
|
|
|
namespace Autotest {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class TestRunConfiguration : public ProjectExplorer::RunConfiguration
|
|
|
|
|
{
|
|
|
|
|
public:
|
2016-06-23 07:34:53 +02:00
|
|
|
TestRunConfiguration(ProjectExplorer::Target *parent, TestConfiguration *config)
|
2023-07-14 12:25:47 +02:00
|
|
|
: ProjectExplorer::RunConfiguration(parent, "AutoTest.TestRunConfig"),
|
|
|
|
|
debuggerAspect(parent)
|
2016-06-15 12:29:24 +02:00
|
|
|
{
|
2023-02-10 16:15:49 +01:00
|
|
|
setDefaultDisplayName(QCoreApplication::translate("QtC::Autotest", "AutoTest Debug"));
|
2016-06-23 09:32:32 +02:00
|
|
|
|
2017-09-29 15:01:32 +02:00
|
|
|
bool enableQuick = false;
|
|
|
|
|
if (auto debuggable = dynamic_cast<DebuggableTestConfiguration *>(config))
|
|
|
|
|
enableQuick = debuggable->mixedDebugging();
|
|
|
|
|
|
2023-07-14 12:25:47 +02:00
|
|
|
registerAspect(&debuggerAspect);
|
|
|
|
|
debuggerAspect.setUseQmlDebugger(enableQuick);
|
2020-03-16 07:19:52 +01:00
|
|
|
ProjectExplorer::ProjectExplorerPlugin::updateRunActions();
|
2016-06-23 07:34:53 +02:00
|
|
|
m_testConfig = config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ProjectExplorer::Runnable runnable() const override
|
|
|
|
|
{
|
2018-05-16 15:42:03 +02:00
|
|
|
ProjectExplorer::Runnable r;
|
2016-06-23 07:34:53 +02:00
|
|
|
QTC_ASSERT(m_testConfig, return r);
|
2021-08-10 09:19:30 +02:00
|
|
|
r.command.setExecutable(m_testConfig->executableFilePath());
|
2022-06-10 10:18:34 +02:00
|
|
|
r.command.addArgs(m_testConfig->argumentsForTestRunner().join(' '), Utils::CommandLine::Raw);
|
2021-08-02 18:02:10 +02:00
|
|
|
r.workingDirectory = m_testConfig->workingDirectory();
|
2016-06-23 07:34:53 +02:00
|
|
|
r.environment = m_testConfig->environment();
|
|
|
|
|
return r;
|
2016-06-15 12:29:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
2018-05-31 07:38:04 +02:00
|
|
|
TestConfiguration *m_testConfig = nullptr;
|
2023-07-14 12:25:47 +02:00
|
|
|
Debugger::DebuggerRunConfigurationAspect debuggerAspect;
|
2016-06-15 12:29:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Autotest
|