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
|
|
|
|
|
|
|
|
|
|
#include "testtreeitem.h"
|
|
|
|
|
#include "itestparser.h"
|
|
|
|
|
|
|
|
|
|
namespace Autotest {
|
|
|
|
|
|
2016-10-05 12:39:23 +02:00
|
|
|
class IFrameworkSettings;
|
|
|
|
|
|
2020-10-06 14:02:29 +02:00
|
|
|
class ITestBase
|
2016-06-01 16:22:50 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2020-10-06 14:02:29 +02:00
|
|
|
explicit ITestBase(bool activeByDefault);
|
|
|
|
|
virtual ~ITestBase() = default;
|
2016-06-01 16:22:50 +02:00
|
|
|
|
|
|
|
|
virtual const char *name() const = 0;
|
|
|
|
|
virtual unsigned priority() const = 0; // should this be modifyable?
|
2020-03-12 13:58:09 +01:00
|
|
|
|
2020-04-17 17:04:35 +02:00
|
|
|
TestTreeItem *rootNode();
|
2016-06-01 16:22:50 +02:00
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
Utils::Id settingsId() const;
|
|
|
|
|
Utils::Id id() const;
|
2020-03-13 12:16:26 +01:00
|
|
|
|
2016-06-06 15:35:00 +02:00
|
|
|
bool active() const { return m_active; }
|
|
|
|
|
void setActive(bool active) { m_active = active; }
|
2020-10-06 14:02:29 +02:00
|
|
|
|
|
|
|
|
void resetRootNode();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual TestTreeItem *createRootNode() = 0;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
TestTreeItem *m_rootNode = nullptr;
|
|
|
|
|
bool m_active = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ITestFramework : public ITestBase
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
explicit ITestFramework(bool activeByDefault);
|
|
|
|
|
~ITestFramework() override;
|
|
|
|
|
|
|
|
|
|
virtual IFrameworkSettings *frameworkSettings() { return nullptr; }
|
|
|
|
|
|
|
|
|
|
ITestParser *testParser();
|
|
|
|
|
|
2017-12-06 08:45:36 +01:00
|
|
|
bool grouping() const { return m_grouping; }
|
|
|
|
|
void setGrouping(bool group) { m_grouping = group; }
|
2018-03-13 10:04:46 +01:00
|
|
|
// framework specific tool tip to be displayed on the general settings page
|
|
|
|
|
virtual QString groupingToolTip() const { return QString(); }
|
2020-03-16 12:59:23 +01:00
|
|
|
|
2016-06-01 16:22:50 +02:00
|
|
|
protected:
|
2020-03-13 13:54:33 +01:00
|
|
|
virtual ITestParser *createTestParser() = 0;
|
2016-06-01 16:22:50 +02:00
|
|
|
|
|
|
|
|
private:
|
2018-05-31 07:38:04 +02:00
|
|
|
ITestParser *m_testParser = nullptr;
|
2017-12-06 08:45:36 +01:00
|
|
|
bool m_grouping = false;
|
2016-06-01 16:22:50 +02:00
|
|
|
};
|
|
|
|
|
|
2020-03-13 13:54:33 +01:00
|
|
|
using TestFrameworks = QList<ITestFramework *>;
|
|
|
|
|
|
2016-06-01 16:22:50 +02:00
|
|
|
} // namespace Autotest
|