2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:58:39 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2016-01-15 14:58:39 +01:00
|
|
|
** 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.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:58:39 +01:00
|
|
|
** 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.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 14:09:21 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#ifndef IPLUGIN_H
|
|
|
|
|
#define IPLUGIN_H
|
|
|
|
|
|
|
|
|
|
#include "extensionsystem_global.h"
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
2014-08-26 15:42:40 +02:00
|
|
|
#include <QtPlugin>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
namespace ExtensionSystem {
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
class IPluginPrivate;
|
|
|
|
|
class PluginSpecPrivate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class PluginManager;
|
|
|
|
|
class PluginSpec;
|
|
|
|
|
|
|
|
|
|
class EXTENSIONSYSTEM_EXPORT IPlugin : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2010-07-13 13:36:47 +02:00
|
|
|
enum ShutdownFlag {
|
|
|
|
|
SynchronousShutdown,
|
|
|
|
|
AsynchronousShutdown
|
|
|
|
|
};
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
IPlugin();
|
|
|
|
|
virtual ~IPlugin();
|
|
|
|
|
|
|
|
|
|
virtual bool initialize(const QStringList &arguments, QString *errorString) = 0;
|
|
|
|
|
virtual void extensionsInitialized() = 0;
|
2012-02-02 10:47:33 +01:00
|
|
|
virtual bool delayedInitialize() { return false; }
|
2010-07-13 13:36:47 +02:00
|
|
|
virtual ShutdownFlag aboutToShutdown() { return SynchronousShutdown; }
|
2015-03-09 10:59:58 +02:00
|
|
|
virtual QObject *remoteCommand(const QStringList & /* options */,
|
|
|
|
|
const QString & /* workingDirectory */,
|
|
|
|
|
const QStringList & /* arguments */) { return 0; }
|
Plugin Tests: Support additional test objects/classes
So far tests running within Qt Creator could be implemented with a
private slot in the plugin class starting with "test".
Binding the test functions to the plugin object/class is fine for test
functions without side effects. But as soon as side effects come into
play we need proper initialization and cleanup as it's provided by
init(), cleanup(), initTestCase() and cleanupTestCase(). However,
implementing these functions in the plugin class is not appropriate
since they would affect (potentially quite diverse) test functions.
This patch enables us to provide 'ordinary' test classes in which we can
handle initialization and clean up the usual way.
In addition to the current test invocations, e.g.:
# (1) Run all test functions of the plugin
./qtcreator -test CppTools
# (2) Run selected test functions of the plugin by stating them
./qtcreator -test CppTools,test_completion,test_builtinsymbolsearcher
# (3) Run selected test functions of the plugin by a wild card
# expression
./qtcreator -test "CppTools,*pointerdeclaration*"
# (4) Run a test function of the plugin with certain test data
./qtcreator -test CppTools,test_completion:template_1
it's now also possible to state the test class in order to execute all
test functions of that class:
# Run all test functions of a certain class:
./qtcreator -test CppTools,SomeClassWithTests
As long as the test class does not start with "test", there should not
be any problems.
Further, an invocation like (1) now additionally execute all test
functions of all test classes. For invocations of type (2), (3) and (4)
all test functions of all test classes are considered, too.
Change-Id: Ief08a6e9e451c599fd0109b8b8e57f92e3ee19f2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2015-01-15 13:14:35 +01:00
|
|
|
virtual QList<QObject *> createTestObjects() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
PluginSpec *pluginSpec() const;
|
|
|
|
|
|
|
|
|
|
void addObject(QObject *obj);
|
|
|
|
|
void addAutoReleasedObject(QObject *obj);
|
|
|
|
|
void removeObject(QObject *obj);
|
|
|
|
|
|
2010-07-13 13:36:47 +02:00
|
|
|
signals:
|
|
|
|
|
void asynchronousShutdownFinished();
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
private:
|
|
|
|
|
Internal::IPluginPrivate *d;
|
|
|
|
|
|
|
|
|
|
friend class Internal::PluginSpecPrivate;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace ExtensionSystem
|
|
|
|
|
|
|
|
|
|
#endif // IPLUGIN_H
|