2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2014-10-07 12:30:54 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2014-10-07 12:30:54 +02:00
|
|
|
|
|
|
|
|
#include "autotest_global.h"
|
|
|
|
|
|
|
|
|
|
#include <extensionsystem/iplugin.h>
|
|
|
|
|
|
2019-08-05 15:47:10 +02:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
class Project;
|
|
|
|
|
class RunConfiguration;
|
|
|
|
|
}
|
2018-08-08 12:40:03 +02:00
|
|
|
|
2014-10-07 12:30:54 +02:00
|
|
|
namespace Autotest {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2019-08-05 15:47:10 +02:00
|
|
|
class TestProjectSettings;
|
2014-12-04 14:05:19 +01:00
|
|
|
struct TestSettings;
|
|
|
|
|
|
2018-08-08 12:40:03 +02:00
|
|
|
struct ChoicePair
|
|
|
|
|
{
|
|
|
|
|
explicit ChoicePair(const QString &name = QString(), const QString &exe = QString())
|
|
|
|
|
: displayName(name), executable(exe) {}
|
|
|
|
|
bool matches(const ProjectExplorer::RunConfiguration *rc) const;
|
|
|
|
|
|
|
|
|
|
QString displayName;
|
|
|
|
|
QString executable;
|
|
|
|
|
};
|
|
|
|
|
|
2014-10-07 12:30:54 +02:00
|
|
|
class AutotestPlugin : public ExtensionSystem::IPlugin
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "AutoTest.json")
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
AutotestPlugin();
|
2018-07-11 15:44:51 +02:00
|
|
|
~AutotestPlugin() override;
|
2014-10-07 12:30:54 +02:00
|
|
|
|
2016-09-29 12:15:43 +02:00
|
|
|
bool initialize(const QStringList &arguments, QString *errorString) override;
|
|
|
|
|
void extensionsInitialized() override;
|
|
|
|
|
ShutdownFlag aboutToShutdown() override;
|
2018-02-01 09:17:56 +01:00
|
|
|
|
2020-02-28 12:27:13 +01:00
|
|
|
static TestSettings *settings();
|
2019-08-05 15:47:10 +02:00
|
|
|
static TestProjectSettings *projectSettings(ProjectExplorer::Project *project);
|
2018-02-01 09:17:56 +01:00
|
|
|
static void updateMenuItemsEnabledState();
|
2018-08-08 12:40:03 +02:00
|
|
|
static void cacheRunConfigChoice(const QString &buildTargetKey, const ChoicePair &choice);
|
|
|
|
|
static ChoicePair cachedChoiceFor(const QString &buildTargetKey);
|
|
|
|
|
static void clearChoiceCache();
|
2019-03-13 11:05:22 +01:00
|
|
|
static void popupResultsPane();
|
2014-10-07 12:30:54 +02:00
|
|
|
|
2014-12-04 14:05:19 +01:00
|
|
|
private:
|
2019-05-27 14:12:11 +02:00
|
|
|
QVector<QObject *> createTestObjects() const override;
|
2014-10-07 12:30:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Autotest
|