2016-06-01 16:22:50 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2018-02-01 09:17:56 +01:00
|
|
|
#include "itestframework.h"
|
|
|
|
|
|
2016-06-01 16:22:50 +02:00
|
|
|
#include <QHash>
|
|
|
|
|
|
2016-10-05 12:39:23 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QSettings;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2016-06-01 16:22:50 +02:00
|
|
|
namespace Core { class Id; }
|
|
|
|
|
|
|
|
|
|
namespace Autotest {
|
2019-09-02 17:51:07 +02:00
|
|
|
|
|
|
|
|
class TestTreeItem;
|
|
|
|
|
|
2016-06-01 16:22:50 +02:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2019-08-19 10:55:32 +02:00
|
|
|
class TestRunner;
|
|
|
|
|
struct TestSettings;
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-05 12:39:23 +02:00
|
|
|
class IFrameworkSettings;
|
2016-06-01 16:22:50 +02:00
|
|
|
class ITestParser;
|
|
|
|
|
class TestTreeModel;
|
|
|
|
|
|
|
|
|
|
class TestFrameworkManager
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
static TestFrameworkManager *instance();
|
|
|
|
|
virtual ~TestFrameworkManager();
|
|
|
|
|
bool registerTestFramework(ITestFramework *framework);
|
2016-06-06 15:35:00 +02:00
|
|
|
|
2020-02-28 12:27:13 +01:00
|
|
|
void activateFrameworksFromSettings(const Internal::TestSettings *settings);
|
2016-06-06 15:35:00 +02:00
|
|
|
QString frameworkNameForId(const Core::Id &id) const;
|
2016-06-01 16:22:50 +02:00
|
|
|
QList<Core::Id> registeredFrameworkIds() const;
|
2016-06-06 15:35:00 +02:00
|
|
|
QList<Core::Id> sortedRegisteredFrameworkIds() const;
|
2019-08-07 10:25:43 +02:00
|
|
|
QList<Core::Id> sortedActiveFrameworkIds() const;
|
2016-06-01 16:22:50 +02:00
|
|
|
|
|
|
|
|
TestTreeItem *rootNodeForTestFramework(const Core::Id &frameworkId) const;
|
|
|
|
|
ITestParser *testParserForTestFramework(const Core::Id &frameworkId) const;
|
2020-03-12 13:58:09 +01:00
|
|
|
IFrameworkSettings *settingsForTestFramework(const Core::Id &frameworkId) const;
|
2016-10-05 12:39:23 +02:00
|
|
|
void synchronizeSettings(QSettings *s);
|
2016-06-06 15:35:00 +02:00
|
|
|
bool isActive(const Core::Id &frameworkId) const;
|
2017-12-06 08:45:36 +01:00
|
|
|
bool groupingEnabled(const Core::Id &frameworkId) const;
|
|
|
|
|
void setGroupingEnabledFor(const Core::Id &frameworkId, bool enabled);
|
2018-03-13 10:04:46 +01:00
|
|
|
QString groupingToolTip(const Core::Id &frameworkId) const;
|
2016-06-08 12:56:25 +02:00
|
|
|
bool hasActiveFrameworks() const;
|
2019-08-07 10:25:43 +02:00
|
|
|
unsigned priority(const Core::Id &frameworkId) const;
|
2016-06-01 16:22:50 +02:00
|
|
|
private:
|
2019-08-07 10:25:43 +02:00
|
|
|
QList<Core::Id> activeFrameworkIds() const;
|
2016-06-01 16:22:50 +02:00
|
|
|
explicit TestFrameworkManager();
|
|
|
|
|
QHash<Core::Id, ITestFramework *> m_registeredFrameworks;
|
2020-03-12 13:58:09 +01:00
|
|
|
QHash<Core::Id, IFrameworkSettings *> m_frameworkSettings;
|
2016-06-01 16:22:50 +02:00
|
|
|
TestTreeModel *m_testTreeModel;
|
2019-08-19 10:55:32 +02:00
|
|
|
Internal::TestRunner *m_testRunner;
|
2016-06-06 15:35:00 +02:00
|
|
|
|
|
|
|
|
typedef QHash<Core::Id, ITestFramework *>::ConstIterator FrameworkIterator;
|
2016-06-01 16:22:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Autotest
|