diff options
author | con <qtc-committer@nokia.com> | 2010-11-08 14:36:26 +0100 |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2010-11-08 15:12:06 +0100 |
commit | 71fd308c6141b4160f341712bb22e3f53ee3ec8a (patch) | |
tree | 4d5a0fd472109e6845b8636bb22204a0ec9e8c4e /src/libs/extensionsystem | |
parent | 06afc48da1c96d1863df699ea8b970840b9d30ff (diff) | |
download | qt-creator-71fd308c6141b4160f341712bb22e3f53ee3ec8a.tar.gz |
Move extension system auto tests.
Diffstat (limited to 'src/libs/extensionsystem')
59 files changed, 0 insertions, 1794 deletions
diff --git a/src/libs/extensionsystem/test/auto/auto.pro b/src/libs/extensionsystem/test/auto/auto.pro deleted file mode 100644 index f988a84e10..0000000000 --- a/src/libs/extensionsystem/test/auto/auto.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = pluginmanager \ - pluginspec - diff --git a/src/libs/extensionsystem/test/auto/copy.pri b/src/libs/extensionsystem/test/auto/copy.pri deleted file mode 100644 index a24fc8f940..0000000000 --- a/src/libs/extensionsystem/test/auto/copy.pri +++ /dev/null @@ -1,11 +0,0 @@ -#set COPYFILES and COPYDIR - -# stolen from qtcreatorplugin.pri -copy2build.input = COPYFILES -copy2build.output = $$COPYDIR/${QMAKE_FUNC_FILE_IN_stripSrcDir} -isEmpty(vcproj):copy2build.variable_out = PRE_TARGETDEPS -copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} -copy2build.name = COPY ${QMAKE_FILE_IN} -copy2build.CONFIG += no_link -QMAKE_EXTRA_COMPILERS += copy2build - diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/circularplugins.pro b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/circularplugins.pro deleted file mode 100644 index 21f257cf08..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/circularplugins.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = plugin1 plugin2 plugin3 diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin.xml b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin.xml deleted file mode 100644 index db201f34c3..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin.xml +++ /dev/null @@ -1,6 +0,0 @@ -<plugin name="plugin1" version="1.0.0" compatVersion="1.0.0"> - <dependencyList> - <dependency name="plugin2" version="1.0.0"/> - <dependency name="plugin3" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.cpp deleted file mode 100644 index 1beff8072c..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "plugin1.h" - -#include <QtCore/qplugin.h> - -using namespace Plugin1; - -MyPlugin1::MyPlugin1() -{ -} - -bool MyPlugin1::initialize(const QStringList &arguments, QString *errorString) -{ - Q_UNUSED(arguments) - Q_UNUSED(errorString) - return true; -} - -void MyPlugin1::extensionsInitialized() -{ -} - -Q_EXPORT_PLUGIN(MyPlugin1) - diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.h b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.h deleted file mode 100644 index 83b3d34db3..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef PLUGIN1_H -#define PLUGIN1_H - -#include <extensionsystem/iplugin.h> - -#include <QtCore/QObject> - -namespace Plugin1 { - -class MyPlugin1 : public ExtensionSystem::IPlugin -{ - Q_OBJECT - -public: - MyPlugin1(); - - bool initialize(const QStringList &arguments, QString *errorString); - void extensionsInitialized(); -}; - -} // namespace Plugin1 - -#endif // PLUGIN1_H diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.pro b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.pro deleted file mode 100644 index 976752c535..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin1/plugin1.pro +++ /dev/null @@ -1,16 +0,0 @@ -TEMPLATE = lib - -SOURCES += plugin1.cpp -HEADERS += plugin1.h - -OTHER_FILES = $$PWD/plugin.xml - -include(../../../../../../../../qtcreator.pri) -include(../../../../../extensionsystem.pri) -include(../../../../../../../../tests/auto/qttestrpath.pri) - -COPYDIR = $$OUT_PWD -COPYFILES = $$OTHER_FILES -include(../../../copy.pri) - -TARGET = $$qtLibraryName(plugin1) diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin.xml b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin.xml deleted file mode 100644 index 5436967a80..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="plugin2" version="1.0.0" compatVersion="1.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.cpp deleted file mode 100644 index 2e43709a03..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "plugin2.h" - -#include <QtCore/qplugin.h> - -using namespace Plugin2; - -MyPlugin2::MyPlugin2() -{ -} - -bool MyPlugin2::initialize(const QStringList &, QString *) -{ - return true; -} - -void MyPlugin2::extensionsInitialized() -{ -} - -Q_EXPORT_PLUGIN(MyPlugin2) - diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.h b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.h deleted file mode 100644 index d98083f359..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef PLUGIN2_H -#define PLUGIN2_H - -#include <extensionsystem/iplugin.h> - -#include <QtCore/QObject> - -namespace Plugin2 { - -class MyPlugin2 : public ExtensionSystem::IPlugin -{ - Q_OBJECT - -public: - MyPlugin2(); - - bool initialize(const QStringList &arguments, QString *errorString); - void extensionsInitialized(); -}; - -} // Plugin2 - -#endif // PLUGIN2_H diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.pro b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.pro deleted file mode 100644 index ff46c01cd3..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin2/plugin2.pro +++ /dev/null @@ -1,16 +0,0 @@ -TEMPLATE = lib - -SOURCES += plugin2.cpp -HEADERS += plugin2.h - -OTHER_FILES = $$PWD/plugin.xml - -include(../../../../../../../../qtcreator.pri) -include(../../../../../extensionsystem.pri) -include(../../../../../../../../tests/auto/qttestrpath.pri) - -COPYDIR = $$OUT_PWD -COPYFILES = $$OTHER_FILES -include(../../../copy.pri) - -TARGET = $$qtLibraryName(plugin2) diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin.xml b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin.xml deleted file mode 100644 index f7e90978ba..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin.xml +++ /dev/null @@ -1,5 +0,0 @@ -<plugin name="plugin3" version="1.0.0" compatVersion="1.0.0"> - <dependencyList> - <dependency name="plugin1" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.cpp deleted file mode 100644 index 4ef2671d57..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ -#include "plugin3.h" - -#include <QtCore/qplugin.h> - -using namespace Plugin3; - -MyPlugin3::MyPlugin3() -{ -} - -bool MyPlugin3::initialize(const QStringList &, QString *) -{ - return true; -} - -void MyPlugin3::extensionsInitialized() -{ -} - -Q_EXPORT_PLUGIN(MyPlugin3) - diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.h b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.h deleted file mode 100644 index 39d8d0991b..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.h +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef PLUGIN3_H -#define PLUGIN3_H - -#include <extensionsystem/iplugin.h> - -#include <QtCore/QObject> - -namespace Plugin3 { - -class MyPlugin3 : public ExtensionSystem::IPlugin -{ - Q_OBJECT - -public: - MyPlugin3(); - - bool initialize(const QStringList &arguments, QString *errorString); - void extensionsInitialized(); -}; - -} // namespace Plugin3 - -#endif // PLUGIN3_H diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.pro b/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.pro deleted file mode 100644 index 5f3e5b4551..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/circularplugins/plugin3/plugin3.pro +++ /dev/null @@ -1,16 +0,0 @@ -TEMPLATE = lib - -SOURCES += plugin3.cpp -HEADERS += plugin3.h - -OTHER_FILES = $$PWD/plugin.xml - -include(../../../../../../../../qtcreator.pri) -include(../../../../../extensionsystem.pri) -include(../../../../../../../../tests/auto/qttestrpath.pri) - -COPYDIR = $$OUT_PWD -COPYFILES = $$OTHER_FILES -include(../../../copy.pri) - -TARGET = $$qtLibraryName(plugin3) diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/correctplugins1.pro b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/correctplugins1.pro deleted file mode 100644 index f0d76950e8..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/correctplugins1.pro +++ /dev/null @@ -1,3 +0,0 @@ -TEMPLATE = subdirs -CONFIG += ordered -SUBDIRS = plugin2 plugin3 plugin1 diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin.spec b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin.spec deleted file mode 100644 index db201f34c3..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin.spec +++ /dev/null @@ -1,6 +0,0 @@ -<plugin name="plugin1" version="1.0.0" compatVersion="1.0.0"> - <dependencyList> - <dependency name="plugin2" version="1.0.0"/> - <dependency name="plugin3" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.cpp deleted file mode 100644 index 3af1e412a3..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "plugin1.h" - -#include <extensionsystem/pluginmanager.h> - -#include <QtCore/qplugin.h> -#include <QtCore/QObject> - -using namespace Plugin1; - -MyPlugin1::MyPlugin1() - : initializeCalled(false) -{ -} - -bool MyPlugin1::initialize(const QStringList & /*arguments*/, QString *errorString) -{ - initializeCalled = true; - QObject *obj = new QObject; - obj->setObjectName("MyPlugin1"); - addAutoReleasedObject(obj); - - bool found2 = false; - bool found3 = false; - foreach (QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) { - if (object->objectName() == "MyPlugin2") - found2 = true; - else if (object->objectName() == "MyPlugin3") - found3 = true; - } - if (found2 && found3) - return true; - if (errorString) { - QString error = "object(s) missing from plugin(s):"; - if (!found2) - error.append(" plugin2"); - if (!found3) - error.append(" plugin3"); - *errorString = error; - } - return false; -} - -void MyPlugin1::extensionsInitialized() -{ - if (!initializeCalled) - return; - // don't do this at home, it's just done here for the test - QObject *obj = new QObject; - obj->setObjectName("MyPlugin1_running"); - addAutoReleasedObject(obj); -} - -Q_EXPORT_PLUGIN(MyPlugin1) - diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.h b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.h deleted file mode 100644 index aa700c283c..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.h +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef PLUGIN1_H -#define PLUGIN1_H - -#include <extensionsystem/iplugin.h> - -#include <QtCore/QObject> - -namespace Plugin1 { - -class MyPlugin1 : public ExtensionSystem::IPlugin -{ - Q_OBJECT - -public: - MyPlugin1(); - - bool initialize(const QStringList &arguments, QString *errorString); - void extensionsInitialized(); - -private: - bool initializeCalled; -}; - -} // namespace Plugin1 - -#endif // PLUGIN1_H diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.pro b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.pro deleted file mode 100644 index c68c5ba285..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin1/plugin1.pro +++ /dev/null @@ -1,24 +0,0 @@ -TEMPLATE = lib - -SOURCES += plugin1.cpp -HEADERS += plugin1.h - -OTHER_FILES = $$PWD/plugin.spec - -include(../../../../../../../../qtcreator.pri) -include(../../../../../extensionsystem.pri) -include(../../../../../../../../tests/auto/qttestrpath.pri) - -COPYDIR = $$OUT_PWD -COPYFILES = $$OTHER_FILES -include(../../../copy.pri) - -TARGET = $$qtLibraryName(plugin1) - -LIBS += -L$${OUT_PWD}/../plugin2 -L$${OUT_PWD}/../plugin3 -l$$qtLibraryName(plugin2) -l$$qtLibraryName(plugin3) - -macx { -} else:unix { - QMAKE_RPATHDIR += $${OUT_PWD}/../plugin2 - QMAKE_RPATHDIR += $${OUT_PWD}/../plugin3 -} diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin.spec b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin.spec deleted file mode 100644 index 5436967a80..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin.spec +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="plugin2" version="1.0.0" compatVersion="1.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.cpp deleted file mode 100644 index 182339f2ea..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "plugin2.h" - -#include <extensionsystem/pluginmanager.h> - -#include <QtCore/qplugin.h> -#include <QtCore/QObject> - -using namespace Plugin2; - -MyPlugin2::MyPlugin2() - : initializeCalled(false) -{ -} - -bool MyPlugin2::initialize(const QStringList &, QString *) -{ - initializeCalled = true; - QObject *obj = new QObject; - obj->setObjectName("MyPlugin2"); - addAutoReleasedObject(obj); - - return true; -} - -void MyPlugin2::extensionsInitialized() -{ - if (!initializeCalled) - return; - // don't do this at home, it's just done here for the test - QObject *obj = new QObject; - obj->setObjectName("MyPlugin2_running"); - addAutoReleasedObject(obj); -} - -Q_EXPORT_PLUGIN(MyPlugin2) - diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.h b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.h deleted file mode 100644 index fa39479d7a..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.h +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef PLUGIN2_H -#define PLUGIN2_H - -#include <extensionsystem/iplugin.h> - -#include <QtCore/QObject> - -namespace Plugin2 { - -class MyPlugin2 : public ExtensionSystem::IPlugin -{ - Q_OBJECT - -public: - MyPlugin2(); - - bool initialize(const QStringList &arguments, QString *errorString); - void extensionsInitialized(); - -private: - bool initializeCalled; -}; - -} // namespace Plugin2 - -#endif // PLUGIN2_H diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.pro b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.pro deleted file mode 100644 index c7caaf5fa2..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin2/plugin2.pro +++ /dev/null @@ -1,21 +0,0 @@ -TEMPLATE = lib - -SOURCES += plugin2.cpp -HEADERS += plugin2.h - -OTHER_FILES = $$PWD/plugin.spec - -include(../../../../../../../../qtcreator.pri) -include(../../../../../extensionsystem.pri) -include(../../../../../../../../tests/auto/qttestrpath.pri) - -COPYDIR = $$OUT_PWD -COPYFILES = $$OTHER_FILES -include(../../../copy.pri) - -TARGET = $$qtLibraryName(plugin2) - -macx { - QMAKE_LFLAGS_SONAME = -Wl,-install_name,$${OUT_PWD}/ -} - diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin.spec b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin.spec deleted file mode 100644 index 234bf56ea2..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin.spec +++ /dev/null @@ -1,5 +0,0 @@ -<plugin name="plugin3" version="1.0.0" compatVersion="1.0.0"> - <dependencyList> - <dependency name="plugin2" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.cpp deleted file mode 100644 index 9a52be199c..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "plugin3.h" - -#include <extensionsystem/pluginmanager.h> - -#include <QtCore/qplugin.h> -#include <QtCore/QObject> - -using namespace Plugin3; - -MyPlugin3::MyPlugin3() - : initializeCalled(false) -{ -} - -bool MyPlugin3::initialize(const QStringList & /*arguments*/, QString *errorString) -{ - initializeCalled = true; - QObject *obj = new QObject; - obj->setObjectName("MyPlugin3"); - addAutoReleasedObject(obj); - - bool found2 = false; - foreach (QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) { - if (object->objectName() == "MyPlugin2") - found2 = true; - } - if (found2) - return true; - if (errorString) - *errorString = "object from plugin2 could not be found"; - return false; -} - -void MyPlugin3::extensionsInitialized() -{ - if (!initializeCalled) - return; - // don't do this at home, it's just done here for the test - QObject *obj = new QObject; - obj->setObjectName("MyPlugin3_running"); - addAutoReleasedObject(obj); -} - -Q_EXPORT_PLUGIN(MyPlugin3) diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.h b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.h deleted file mode 100644 index 8143b46a15..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.h +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ -#ifndef PLUGIN3_H -#define PLUGIN3_H - -#include <extensionsystem/iplugin.h> - -#include <QtCore/QObject> - -namespace Plugin3 { - -class MyPlugin3 : public ExtensionSystem::IPlugin -{ - Q_OBJECT - -public: - MyPlugin3(); - - bool initialize(const QStringList &arguments, QString *errorString); - void extensionsInitialized(); - -private: - bool initializeCalled; -}; - -} // namespace Plugin3 - -#endif // PLUGIN3_H diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.pro b/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.pro deleted file mode 100644 index e142575ec9..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/correctplugins1/plugin3/plugin3.pro +++ /dev/null @@ -1,24 +0,0 @@ -TEMPLATE = lib - -SOURCES += plugin3.cpp -HEADERS += plugin3.h - -OTHER_FILES = $$PWD/plugin.spec - -include(../../../../../../../../qtcreator.pri) -include(../../../../../extensionsystem.pri) -include(../../../../../../../../tests/auto/qttestrpath.pri) - -COPYDIR = $$OUT_PWD -COPYFILES = $$OTHER_FILES -include(../../../copy.pri) - -TARGET = $$qtLibraryName(plugin3) - -LIBS += -L$${OUT_PWD}/../plugin2 -l$$qtLibraryName(plugin2) - -macx { - QMAKE_LFLAGS_SONAME = -Wl,-install_name,$${OUT_PWD}/ -} else:unix { - QMAKE_RPATHDIR += $${OUT_PWD}/../plugin2 -} diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/pluginmanager.pro b/src/libs/extensionsystem/test/auto/pluginmanager/pluginmanager.pro deleted file mode 100644 index 57b026f5fb..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/pluginmanager.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS = test.pro \ - circularplugins \ - correctplugins1 - diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/plugins/myplug/myplug.xml b/src/libs/extensionsystem/test/auto/pluginmanager/plugins/myplug/myplug.xml deleted file mode 100644 index c79b29780d..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/plugins/myplug/myplug.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="dummyPlugin" version="1.1.1" compatVersion="1.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/plugins/otherplugin.xml b/src/libs/extensionsystem/test/auto/pluginmanager/plugins/otherplugin.xml deleted file mode 100644 index 6f0483f0f8..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/plugins/otherplugin.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="helloworld" version="1.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/plugins/plugin1.xml b/src/libs/extensionsystem/test/auto/pluginmanager/plugins/plugin1.xml deleted file mode 100644 index 6bd573957b..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/plugins/plugin1.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="MyPlugin" version="2.2.3_9" compatVersion="2.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/test.pro b/src/libs/extensionsystem/test/auto/pluginmanager/test.pro deleted file mode 100644 index bcdc8c2d9d..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/test.pro +++ /dev/null @@ -1,20 +0,0 @@ -###################################################################### -# Automatically generated by qmake (2.01a) Fr Jul 27 23:12:52 2007 -###################################################################### - -TARGET = pluginmanager - -# Input - -include(../../../../../../tests/auto/qttest.pri) -include(../../../extensionsystem.pri) - -SOURCES += tst_pluginmanager.cpp - -OTHER_FILES = $$PWD/plugins/otherplugin.xml \ - $$PWD/plugins/plugin1.xml \ - $$PWD/plugins/myplug/myplug.xml - -COPYDIR = $$OUT_PWD -COPYFILES = $$OTHER_FILES -include(../copy.pri) diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/test.sh b/src/libs/extensionsystem/test/auto/pluginmanager/test.sh deleted file mode 100755 index 426901ea74..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/test.sh +++ /dev/null @@ -1,5 +0,0 @@ -# -- run the plugin test from this directory. - -export LD_LIBRARY_PATH=../../../../../../lib:$LD_LIBRARY_PATH -export DYLD_LIBRARY_PATH=../../../../../../bin/QtCreator.app/Contents/PlugIns:$DYLD_LIBRARY_PATH # mac -exec ./test diff --git a/src/libs/extensionsystem/test/auto/pluginmanager/tst_pluginmanager.cpp b/src/libs/extensionsystem/test/auto/pluginmanager/tst_pluginmanager.cpp deleted file mode 100644 index efff80a356..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginmanager/tst_pluginmanager.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include <extensionsystem/pluginmanager.h> -#include <extensionsystem/pluginspec.h> -#include <extensionsystem/iplugin.h> - -#include <QtTest/QtTest> - -#include <QtCore/QObject> - -using namespace ExtensionSystem; - -class SignalReceiver; - -class tst_PluginManager : public QObject -{ - Q_OBJECT - -private slots: - void init(); - void cleanup(); - void addRemoveObjects(); - void getObject(); - void getObjects(); - void plugins(); - void circularPlugins(); - void correctPlugins1(); - -private: - PluginManager *m_pm; - QSignalSpy *m_objectAdded; - QSignalSpy *m_aboutToRemoveObject; - QSignalSpy *m_pluginsChanged; -}; - -class MyClass1 : public QObject -{ - Q_OBJECT -}; - -class MyClass2 : public QObject -{ - Q_OBJECT -}; - -class MyClass11 : public MyClass1 -{ - Q_OBJECT -}; - -void tst_PluginManager::init() -{ - m_pm = new PluginManager; - m_objectAdded = new QSignalSpy(m_pm, SIGNAL(objectAdded(QObject*))); - m_aboutToRemoveObject = new QSignalSpy(m_pm, SIGNAL(aboutToRemoveObject(QObject*))); - m_pluginsChanged = new QSignalSpy(m_pm, SIGNAL(pluginsChanged())); -} - -void tst_PluginManager::cleanup() -{ - delete m_pm; - delete m_objectAdded; - delete m_aboutToRemoveObject; - delete m_pluginsChanged; -} - -void tst_PluginManager::addRemoveObjects() -{ - QObject *object1 = new QObject; - QObject *object2 = new QObject; - QCOMPARE(m_pm->allObjects().size(), 0); - m_pm->addObject(object1); - QCOMPARE(m_objectAdded->count(), 1); - QCOMPARE(m_objectAdded->at(0).first().value<QObject *>(), object1); - QCOMPARE(m_aboutToRemoveObject->count(), 0); - QVERIFY(m_pm->allObjects().contains(object1)); - QVERIFY(!m_pm->allObjects().contains(object2)); - QCOMPARE(m_pm->allObjects().size(), 1); - m_pm->addObject(object2); - QCOMPARE(m_objectAdded->count(), 2); - QCOMPARE(m_objectAdded->at(1).first().value<QObject *>(), object2); - QCOMPARE(m_aboutToRemoveObject->count(), 0); - QVERIFY(m_pm->allObjects().contains(object1)); - QVERIFY(m_pm->allObjects().contains(object2)); - QCOMPARE(m_pm->allObjects().size(), 2); - m_pm->removeObject(object1); - QCOMPARE(m_objectAdded->count(), 2); - QCOMPARE(m_aboutToRemoveObject->count(), 1); - QCOMPARE(m_aboutToRemoveObject->at(0).first().value<QObject *>(), object1); - QVERIFY(!m_pm->allObjects().contains(object1)); - QVERIFY(m_pm->allObjects().contains(object2)); - QCOMPARE(m_pm->allObjects().size(), 1); - m_pm->removeObject(object2); - QCOMPARE(m_objectAdded->count(), 2); - QCOMPARE(m_aboutToRemoveObject->count(), 2); - QCOMPARE(m_aboutToRemoveObject->at(1).first().value<QObject *>(), object2); - QVERIFY(!m_pm->allObjects().contains(object1)); - QVERIFY(!m_pm->allObjects().contains(object2)); - QCOMPARE(m_pm->allObjects().size(), 0); - delete object1; - delete object2; -} - -void tst_PluginManager::getObject() -{ - MyClass2 *object2 = new MyClass2; - MyClass11 *object11 = new MyClass11; - m_pm->addObject(object2); - QCOMPARE(m_pm->getObject<MyClass11>(), (MyClass11*)0); - QCOMPARE(m_pm->getObject<MyClass1>(), (MyClass1*)0); - QCOMPARE(m_pm->getObject<MyClass2>(), object2); - m_pm->addObject(object11); - QCOMPARE(m_pm->getObject<MyClass11>(), object11); - QCOMPARE(m_pm->getObject<MyClass1>(), qobject_cast<MyClass1*>(object11)); - QCOMPARE(m_pm->getObject<MyClass2>(), object2); - m_pm->removeObject(object2); - m_pm->removeObject(object11); - delete object2; - delete object11; -} - -void tst_PluginManager::getObjects() -{ - MyClass1 *object1 = new MyClass1; - MyClass2 *object2 = new MyClass2; - MyClass11 *object11 = new MyClass11; - m_pm->addObject(object2); - QCOMPARE(m_pm->getObjects<MyClass11>(), QList<MyClass11*>()); - QCOMPARE(m_pm->getObjects<MyClass1>(), QList<MyClass1*>()); - QCOMPARE(m_pm->getObjects<MyClass2>(), QList<MyClass2*>() << object2); - QCOMPARE(m_pm->allObjects(), QList<QObject*>() << object2); - m_pm->addObject(object11); - QCOMPARE(m_pm->getObjects<MyClass11>(), QList<MyClass11*>() << object11); - QCOMPARE(m_pm->getObjects<MyClass1>(), QList<MyClass1*>() << object11); - QCOMPARE(m_pm->getObjects<MyClass2>(), QList<MyClass2*>() << object2); - QCOMPARE(m_pm->allObjects(), QList<QObject*>() << object2 << object11); - m_pm->addObject(object1); - QCOMPARE(m_pm->getObjects<MyClass11>(), QList<MyClass11*>() << object11); - QCOMPARE(m_pm->getObjects<MyClass1>(), QList<MyClass1*>() << object11 << object1); - QCOMPARE(m_pm->getObjects<MyClass2>(), QList<MyClass2*>() << object2); - QCOMPARE(m_pm->allObjects(), QList<QObject*>() << object2 << object11 << object1); - m_pm->removeObject(object2); - m_pm->removeObject(object11); - m_pm->removeObject(object1); - delete object1; - delete object2; - delete object11; -} - -void tst_PluginManager::plugins() -{ - m_pm->setPluginPaths(QStringList() << "plugins"); - QCOMPARE(m_pluginsChanged->count(), 1); - QList<PluginSpec *> plugins = m_pm->plugins(); - QCOMPARE(plugins.count(), 3); - foreach (const QString &expected, QStringList() << "helloworld" << "MyPlugin" << "dummyPlugin") { - bool found = false; - foreach (PluginSpec *spec, plugins) { - if (spec->name() == expected) { - found = true; - break; - } - } - QVERIFY2(found, QString("plugin '%1' not found").arg(expected).toLocal8Bit().constData()); - } -} - -void tst_PluginManager::circularPlugins() -{ - m_pm->setPluginPaths(QStringList() << "circularplugins"); - m_pm->loadPlugins(); - foreach (PluginSpec *spec, m_pm->plugins()) { - if (spec->name() == "plugin1") { - QVERIFY(spec->hasError()); - QCOMPARE(spec->state(), PluginSpec::Resolved); - QCOMPARE(spec->plugin(), (IPlugin*)0); - } else if (spec->name() == "plugin2") { - QVERIFY(!spec->hasError()); - QCOMPARE(spec->state(), PluginSpec::Running); - } else if (spec->name() == "plugin3") { - QVERIFY(spec->hasError()); - QCOMPARE(spec->state(), PluginSpec::Resolved); - QCOMPARE(spec->plugin(), (IPlugin*)0); - } - } -} - -void tst_PluginManager::correctPlugins1() -{ - m_pm->setFileExtension("spec"); - m_pm->setPluginPaths(QStringList() << "correctplugins1"); - m_pm->loadPlugins(); - foreach (PluginSpec *spec, m_pm->plugins()) { - if (spec->hasError()) - qDebug() << spec->errorString(); - QVERIFY(!spec->hasError()); - QCOMPARE(spec->state(), PluginSpec::Running); - } - bool plugin1running = false; - bool plugin2running = false; - bool plugin3running = false; - foreach (QObject *obj, m_pm->allObjects()) { - if (obj->objectName() == "MyPlugin1_running") - plugin1running = true; - else if (obj->objectName() == "MyPlugin2_running") - plugin2running = true; - else if (obj->objectName() == "MyPlugin3_running") - plugin3running = true; - } - QVERIFY(plugin1running); - QVERIFY(plugin2running); - QVERIFY(plugin3running); -} - -QTEST_MAIN(tst_PluginManager) - -#include "tst_pluginmanager.moc" - diff --git a/src/libs/extensionsystem/test/auto/pluginspec/pluginspec.pro b/src/libs/extensionsystem/test/auto/pluginspec/pluginspec.pro deleted file mode 100644 index d4b941b232..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/pluginspec.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = subdirs -CONFIG += ordered - -SUBDIRS = testplugin test.pro diff --git a/src/libs/extensionsystem/test/auto/pluginspec/test.pro b/src/libs/extensionsystem/test/auto/pluginspec/test.pro deleted file mode 100644 index 3f0f273081..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/test.pro +++ /dev/null @@ -1,28 +0,0 @@ -TARGET = pluginspec - -# Input -SOURCES += tst_pluginspec.cpp - -OTHER_FILES += \ - $$PWD/testspecs/simplespec.xml \ - $$PWD/testspecs/simplespec_experimental.xml \ - $$PWD/testspecs/spec1.xml \ - $$PWD/testspecs/spec2.xml \ - $$PWD/testspecs/spec_wrong1.xml \ - $$PWD/testspecs/spec_wrong2.xml \ - $$PWD/testspecs/spec_wrong3.xml \ - $$PWD/testspecs/spec_wrong4.xml \ - $$PWD/testspecs/spec_wrong5.xml \ - $$PWD/testdependencies/spec1.xml \ - $$PWD/testdependencies/spec2.xml \ - $$PWD/testdependencies/spec3.xml \ - $$PWD/testdependencies/spec4.xml \ - $$PWD/testdependencies/spec5.xml \ - $$PWD/testdir/spec.xml - -include(../../../../../../tests/auto/qttest.pri) -include(../../../extensionsystem.pri) - -COPYDIR = $$OUT_PWD -COPYFILES = $$OTHER_FILES -include(../copy.pri) diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec1.xml b/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec1.xml deleted file mode 100644 index 137e1b494c..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec1.xml +++ /dev/null @@ -1,6 +0,0 @@ -<plugin name="plugin1" version="1.0.1" compatVersion="1.0.0"> - <dependencyList> - <dependency name="plugin2" version="2.3.0_2"/> - <dependency name="plugin3" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec2.xml b/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec2.xml deleted file mode 100644 index 451f854185..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec2.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="plugin2" version="2.4.1" compatVersion="2.3.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec3.xml b/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec3.xml deleted file mode 100644 index 9fa01a442f..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec3.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="plugin3" version="1.0.0" compatVersion="1.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec4.xml b/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec4.xml deleted file mode 100644 index b06bab2fa0..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec4.xml +++ /dev/null @@ -1,5 +0,0 @@ -<plugin name="plugin4" version="1.0.1" compatVersion="1.0.0"> - <dependencyList> - <dependency name="plugin5" version="2.3.0_2"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec5.xml b/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec5.xml deleted file mode 100644 index aab8f424c3..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testdependencies/spec5.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="plugin5" version="1.0.1" compatVersion="1.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testdir/spec.xml b/src/libs/extensionsystem/test/auto/pluginspec/testdir/spec.xml deleted file mode 100644 index 6bd573957b..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testdir/spec.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="MyPlugin" version="2.2.3_9" compatVersion="2.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.cpp b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.cpp deleted file mode 100644 index e8a233b7bf..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "testplugin.h" - -#include <QtCore/qplugin.h> - -using namespace MyPlugin; - -MyPluginImpl::MyPluginImpl() - : m_isInitialized(false), m_isExtensionsInitialized(false) -{ -} - -bool MyPluginImpl::initialize(const QStringList &, QString *) -{ - m_isInitialized = true; - return true; -} - -void MyPluginImpl::extensionsInitialized() -{ - m_isExtensionsInitialized = true; -} - -Q_EXPORT_PLUGIN(MyPluginImpl) - diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.h b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.h deleted file mode 100644 index 490eb8b33d..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.h +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef TESTPLUGIN_H -#define TESTPLUGIN_H - -#include "testplugin_global.h" -#include <extensionsystem/iplugin.h> - -#include <QtCore/QObject> - -namespace MyPlugin { - -class MYPLUGIN_EXPORT MyPluginImpl : public ExtensionSystem::IPlugin -{ - Q_OBJECT - -public: - MyPluginImpl(); - - bool initialize(const QStringList &arguments, QString *errorString); - void extensionsInitialized(); - -public slots: - bool isInitialized() { return m_isInitialized; } - bool isExtensionsInitialized() { return m_isExtensionsInitialized; } - -private: - bool m_isInitialized; - bool m_isExtensionsInitialized; -}; - -} // namespace - -#endif // TESTPLUGIN_H diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.pro b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.pro deleted file mode 100644 index 6e81d29b13..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.pro +++ /dev/null @@ -1,17 +0,0 @@ -include(../../../../../../../qtcreator.pri) - -TEMPLATE = lib -TARGET = $$qtLibraryName(test) -DEFINES += MYPLUGIN_LIBRARY -SOURCES += testplugin.cpp -HEADERS += testplugin.h testplugin_global.h - -OTHER_FILES += testplugin.xml - -include(../../../../extensionsystem.pri) - -include(../../../../../../../tests/auto/qttestrpath.pri) - -COPYDIR = $$OUT_PWD -COPYFILES = $$PWD/testplugin.xml -include(../../copy.pri) diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.xml b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.xml deleted file mode 100644 index f8ab3f7a39..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="test" version="1.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin_global.h b/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin_global.h deleted file mode 100644 index 2c3150d177..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testplugin/testplugin_global.h +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef TESTPLUGIN_GLOBAL_H -#define TESTPLUGIN_GLOBAL_H - -#include <QtCore/qglobal.h> - -#if defined(MYPLUGIN_LIBRARY) -# define MYPLUGIN_EXPORT Q_DECL_EXPORT -#else -# define MYPLUGIN_EXPORT Q_DECL_IMPORT -#endif - -#endif // TESTPLUGIN_GLOBAL_H diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/simplespec.xml b/src/libs/extensionsystem/test/auto/pluginspec/testspecs/simplespec.xml deleted file mode 100644 index 6bd573957b..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/simplespec.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="MyPlugin" version="2.2.3_9" compatVersion="2.0.0"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/simplespec_experimental.xml b/src/libs/extensionsystem/test/auto/pluginspec/testspecs/simplespec_experimental.xml deleted file mode 100644 index 69fe37c53e..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/simplespec_experimental.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="MyPlugin" version="2.2.3_9" compatVersion="2.0.0" experimental="true"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec1.xml b/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec1.xml deleted file mode 100644 index 994f330bbe..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec1.xml +++ /dev/null @@ -1,18 +0,0 @@ -<plugin name="test" version="1.0.1" compatVersion="1.0.0"> - <vendor>Nokia Corporation</vendor> - <copyright>(C) 2007 Nokia Corporation</copyright> - <license> -This is a default license bla -blubbblubb -end of terms - </license> - <description> -This plugin is just a test. - it demonstrates the great use of the plugin spec. - </description> - <url>http://qt.noki.com</url> - <dependencyList> - <dependency name="SomeOtherPlugin" version="2.3.0_2"/> - <dependency name="EvenOther" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec2.xml b/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec2.xml deleted file mode 100644 index 454f58cb75..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec2.xml +++ /dev/null @@ -1,2 +0,0 @@ -<plugin name="test" version="3.1.4_10"> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong1.xml b/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong1.xml deleted file mode 100644 index ffcb61241e..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong1.xml +++ /dev/null @@ -1,18 +0,0 @@ -<something name="test" version="1.0.1" compatVersion="1.0.0"> - <vendor>Nokia Corporation</vendor> - <copyright>(C) 2007 Nokia Corporation</copyright> - <license> -This is a default license bla -blubbblubb -end of terms - </license> - <description> -This plugin is just a test. - it demonstrates the great use of the plugin spec. - </description> - <url>http://qt.nokia.com</url> - <dependencyList> - <dependency name="SomeOtherPlugin" version="2.3.0_2"/> - <dependency name="EvenOther" version="1.0.0"/> - </dependencyList> -</something> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong2.xml b/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong2.xml deleted file mode 100644 index 917acf78ad..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong2.xml +++ /dev/null @@ -1,18 +0,0 @@ -<plugin version="1.0.1" compatVersion="1.0.0"> - <vendor>Nokia Corporation</vendor> - <copyright>(C) 2007 Nokia Corporation</copyright> - <license> -This is a default license bla -blubbblubb -end of terms - </license> - <description> -This plugin is just a test. - it demonstrates the great use of the plugin spec. - </description> - <url>http://qt.nokia.com</url> - <dependencyList> - <dependency name="SomeOtherPlugin" version="2.3.0_2"/> - <dependency name="EvenOther" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong3.xml b/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong3.xml deleted file mode 100644 index d79ab4492b..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong3.xml +++ /dev/null @@ -1,18 +0,0 @@ -<plugin name="test" compatVersion="1.0.0"> - <vendor>Nokia Corporation</vendor> - <copyright>(C) 2007 Nokia Corporation</copyright> - <license> -This is a default license bla -blubbblubb -end of terms - </license> - <description> -This plugin is just a test. - it demonstrates the great use of the plugin spec. - </description> - <url>http://qt.nokia.com</url> - <dependencyList> - <dependency name="SomeOtherPlugin" version="2.3.0_2"/> - <dependency name="EvenOther" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong4.xml b/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong4.xml deleted file mode 100644 index 849f165f9c..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong4.xml +++ /dev/null @@ -1,18 +0,0 @@ -<plugin name="test" version="1.0.1" compatVersion="1.0.0"> - <vendor>Nokia Corporation</vendor> - <copyright>(C) 2007 Nokia Corporation</copyright> - <license> -This is a default license bla -blubbblubb -end of terms - </license> - <description> -This plugin is just a test. - it demonstrates the great use of the plugin spec. - </description> - <url>http://qt.nokia.com</url> - <dependencyList> - <dependency version="2.3.0_2"/> - <dependency name="EvenOther" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong5.xml b/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong5.xml deleted file mode 100644 index 03936fd88c..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/testspecs/spec_wrong5.xml +++ /dev/null @@ -1,18 +0,0 @@ -<plugin name="test" version="1.0.1" compatVersion="1.0.0"> - <vendor>Nokia Corporation</vendor> - <copyright>(C) 2007 Nokia Corporation</copyright> - <license> -This is a default license bla -blubbblubb -end of terms - </license> - <description> -This plugin is just a test. - it demonstrates the great use of the plugin spec. - </description> - <url>http://qt.nokia.com</url> - <dependencyList> - <dependency name="SomeOtherPlugin" version="2.3aa.0_2"/> - <dependency name="EvenOther" version="1.0.0"/> - </dependencyList> -</plugin> diff --git a/src/libs/extensionsystem/test/auto/pluginspec/tst_pluginspec.cpp b/src/libs/extensionsystem/test/auto/pluginspec/tst_pluginspec.cpp deleted file mode 100644 index b058c35bb9..0000000000 --- a/src/libs/extensionsystem/test/auto/pluginspec/tst_pluginspec.cpp +++ /dev/null @@ -1,291 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include <extensionsystem/pluginspec.h> -#include <extensionsystem/pluginspec_p.h> -#include <extensionsystem/pluginmanager_p.h> -#include <extensionsystem/pluginmanager.h> - -#include <QtCore/QObject> -#include <QtCore/QMetaObject> -#include <QtTest/QtTest> - -using namespace ExtensionSystem; - -class tst_PluginSpec : public QObject -{ - Q_OBJECT - -private slots: - void read(); - void readError(); - void isValidVersion(); - void versionCompare(); - void provides(); - void experimental(); - void locationAndPath(); - void resolveDependencies(); - void loadLibrary(); - void initializePlugin(); - void initializeExtensions(); -}; - -void tst_PluginSpec::read() -{ - Internal::PluginSpecPrivate spec(0); - QCOMPARE(spec.state, PluginSpec::Invalid); - QVERIFY(spec.read("testspecs/spec1.xml")); - QCOMPARE(spec.state, PluginSpec::Read); - QVERIFY(!spec.hasError); - QVERIFY(spec.errorString.isEmpty()); - QCOMPARE(spec.name, QString("test")); - QCOMPARE(spec.version, QString("1.0.1")); - QCOMPARE(spec.compatVersion, QString("1.0.0")); - QCOMPARE(spec.experimental, false); - QCOMPARE(spec.enabled, true); - QCOMPARE(spec.vendor, QString("Nokia Corporation")); - QCOMPARE(spec.copyright, QString("(C) 2007 Nokia Corporation")); - QCOMPARE(spec.license, QString("This is a default license bla\nblubbblubb\nend of terms")); - QCOMPARE(spec.description, QString("This plugin is just a test.\n it demonstrates the great use of the plugin spec.")); - QCOMPARE(spec.url, QString("http://qt.noki.com")); - PluginDependency dep1; - dep1.name = QString("SomeOtherPlugin"); - dep1.version = QString("2.3.0_2"); - PluginDependency dep2; - dep2.name = QString("EvenOther"); - dep2.version = QString("1.0.0"); - QCOMPARE(spec.dependencies, QList<PluginDependency>() << dep1 << dep2); - - // test missing compatVersion behavior - QVERIFY(spec.read("testspecs/spec2.xml")); - QCOMPARE(spec.version, QString("3.1.4_10")); - QCOMPARE(spec.compatVersion, QString("3.1.4_10")); -} - -void tst_PluginSpec::readError() -{ - Internal::PluginSpecPrivate spec(0); - QCOMPARE(spec.state, PluginSpec::Invalid); - QVERIFY(!spec.read("non-existing-file.xml")); - QCOMPARE(spec.state, PluginSpec::Invalid); - QVERIFY(spec.hasError); - QVERIFY(!spec.errorString.isEmpty()); - QVERIFY(!spec.read("testspecs/spec_wrong1.xml")); - QCOMPARE(spec.state, PluginSpec::Invalid); - QVERIFY(spec.hasError); - QVERIFY(!spec.errorString.isEmpty()); - QVERIFY(!spec.read("testspecs/spec_wrong2.xml")); - QCOMPARE(spec.state, PluginSpec::Invalid); - QVERIFY(spec.hasError); - QVERIFY(!spec.errorString.isEmpty()); - QVERIFY(!spec.read("testspecs/spec_wrong3.xml")); - QCOMPARE(spec.state, PluginSpec::Invalid); - QVERIFY(spec.hasError); - QVERIFY(!spec.errorString.isEmpty()); - QVERIFY(!spec.read("testspecs/spec_wrong4.xml")); - QCOMPARE(spec.state, PluginSpec::Invalid); - QVERIFY(spec.hasError); - QVERIFY(!spec.errorString.isEmpty()); - QVERIFY(!spec.read("testspecs/spec_wrong5.xml")); - QCOMPARE(spec.state, PluginSpec::Invalid); - QVERIFY(spec.hasError); - QVERIFY(!spec.errorString.isEmpty()); -} - -void tst_PluginSpec::isValidVersion() -{ - QVERIFY(Internal::PluginSpecPrivate::isValidVersion("2")); - QVERIFY(Internal::PluginSpecPrivate::isValidVersion("53")); - QVERIFY(Internal::PluginSpecPrivate::isValidVersion("52_1")); - QVERIFY(Internal::PluginSpecPrivate::isValidVersion("3.12")); - QVERIFY(Internal::PluginSpecPrivate::isValidVersion("31.1_12")); - QVERIFY(Internal::PluginSpecPrivate::isValidVersion("31.1.0")); - QVERIFY(Internal::PluginSpecPrivate::isValidVersion("1.0.2_1")); - - QVERIFY(!Internal::PluginSpecPrivate::isValidVersion("")); - QVERIFY(!Internal::PluginSpecPrivate::isValidVersion("1..0")); - QVERIFY(!Internal::PluginSpecPrivate::isValidVersion("1.0_")); - QVERIFY(!Internal::PluginSpecPrivate::isValidVersion("1.0.0.0")); -} - -void tst_PluginSpec::versionCompare() -{ - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3", "3") == 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3.0.0", "3") == 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3.0", "3") == 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3.0.0_1", "3_1") == 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3.0_21", "3_21") == 0); - - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3", "1") > 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3", "1.0_12") > 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3_1", "3") > 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3.1.0_23", "3.1") > 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3.1_23", "3.1_12") > 0); - - QVERIFY(Internal::PluginSpecPrivate::versionCompare("1", "3") < 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("1.0_12", "3") < 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3", "3_1") < 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3.1", "3.1.0_23") < 0); - QVERIFY(Internal::PluginSpecPrivate::versionCompare("3.1_12", "3.1_23") < 0); -} - -void tst_PluginSpec::provides() -{ - Internal::PluginSpecPrivate spec(0); - QVERIFY(spec.read("testspecs/simplespec.xml")); - QVERIFY(!spec.provides("SomeOtherPlugin", "2.2.3_9")); - QVERIFY(!spec.provides("MyPlugin", "2.2.3_10")); - QVERIFY(!spec.provides("MyPlugin", "2.2.4")); - QVERIFY(!spec.provides("MyPlugin", "2.3.11_1")); - QVERIFY(!spec.provides("MyPlugin", "2.3")); - QVERIFY(!spec.provides("MyPlugin", "3.0")); - QVERIFY(!spec.provides("MyPlugin", "1.9.9_99")); - QVERIFY(!spec.provides("MyPlugin", "1.9")); - QVERIFY(!spec.provides("MyPlugin", "0.9")); - QVERIFY(!spec.provides("MyPlugin", "1")); - - QVERIFY(spec.provides("myplugin", "2.2.3_9")); - QVERIFY(spec.provides("MyPlugin", "2.2.3_9")); - QVERIFY(spec.provides("MyPlugin", "2.2.3_8")); - QVERIFY(spec.provides("MyPlugin", "2.2.3")); - QVERIFY(spec.provides("MyPlugin", "2.2.2")); - QVERIFY(spec.provides("MyPlugin", "2.1.2_10")); - QVERIFY(spec.provides("MyPlugin", "2.0_10")); - QVERIFY(spec.provides("MyPlugin", "2")); -} - -void tst_PluginSpec::experimental() -{ - Internal::PluginSpecPrivate spec(0); - QVERIFY(spec.read("testspecs/simplespec_experimental.xml")); - QCOMPARE(spec.experimental, true); - QCOMPARE(spec.enabled, false); -} - -void tst_PluginSpec::locationAndPath() -{ - Internal::PluginSpecPrivate spec(0); - QVERIFY(spec.read("testspecs/simplespec.xml")); - QCOMPARE(spec.location, QDir::currentPath()+"/testspecs"); - QCOMPARE(spec.filePath, QDir::currentPath()+"/testspecs/simplespec.xml"); - QVERIFY(spec.read("testdir/../testspecs/simplespec.xml")); - QCOMPARE(spec.location, QDir::currentPath()+"/testspecs"); - QCOMPARE(spec.filePath, QDir::currentPath()+"/testspecs/simplespec.xml"); - QVERIFY(spec.read("testdir/spec.xml")); - QCOMPARE(spec.location, QDir::currentPath()+"/testdir"); - QCOMPARE(spec.filePath, QDir::currentPath()+"/testdir/spec.xml"); -} - -void tst_PluginSpec::resolveDependencies() -{ - QList<PluginSpec *> specs; - PluginSpec *spec1 = Internal::PluginManagerPrivate::createSpec(); - specs.append(spec1); - Internal::PluginSpecPrivate *spec1Priv = Internal::PluginManagerPrivate::privateSpec(spec1); - spec1Priv->read("testdependencies/spec1.xml"); - PluginSpec *spec2 = Internal::PluginManagerPrivate::createSpec(); - specs.append(spec2); - Internal::PluginManagerPrivate::privateSpec(spec2)->read("testdependencies/spec2.xml"); - PluginSpec *spec3 = Internal::PluginManagerPrivate::createSpec(); - specs.append(spec3); - Internal::PluginManagerPrivate::privateSpec(spec3)->read("testdependencies/spec3.xml"); - PluginSpec *spec4 = Internal::PluginManagerPrivate::createSpec(); - specs.append(spec4); - Internal::PluginSpecPrivate *spec4Priv = Internal::PluginManagerPrivate::privateSpec(spec4); - spec4Priv->read("testdependencies/spec4.xml"); - PluginSpec *spec5 = Internal::PluginManagerPrivate::createSpec(); - specs.append(spec5); - Internal::PluginManagerPrivate::privateSpec(spec5)->read("testdependencies/spec5.xml"); - QVERIFY(spec1Priv->resolveDependencies(specs)); - QCOMPARE(spec1Priv->dependencySpecs.size(), 2); - QVERIFY(spec1Priv->dependencySpecs.contains(spec2)); - QVERIFY(spec1Priv->dependencySpecs.contains(spec3)); - QCOMPARE(spec1Priv->state, PluginSpec::Resolved); - QVERIFY(!spec4Priv->resolveDependencies(specs)); - QVERIFY(spec4Priv->hasError); - QCOMPARE(spec4Priv->state, PluginSpec::Read); -} - -void tst_PluginSpec::loadLibrary() -{ - PluginSpec *ps = Internal::PluginManagerPrivate::createSpec(); - Internal::PluginSpecPrivate *spec = Internal::PluginManagerPrivate::privateSpec(ps); - PluginManager *manager = new PluginManager(); - QVERIFY(spec->read("testplugin/testplugin.xml")); - QVERIFY(spec->resolveDependencies(QList<PluginSpec *>())); - QVERIFY(spec->loadLibrary()); - QVERIFY(spec->plugin != 0); - QVERIFY(QString::fromLocal8Bit(spec->plugin->metaObject()->className()) == QString::fromLocal8Bit("MyPlugin::MyPluginImpl")); - QCOMPARE(spec->state, PluginSpec::Loaded); - QVERIFY(!spec->hasError); - QCOMPARE(spec->plugin->pluginSpec(), ps); - delete manager; - delete ps; -} - -void tst_PluginSpec::initializePlugin() -{ - Internal::PluginSpecPrivate spec(0); - QVERIFY(spec.read("testplugin/testplugin.xml")); - QVERIFY(spec.resolveDependencies(QList<PluginSpec *>())); - QVERIFY(spec.loadLibrary()); - bool isInitialized; - QMetaObject::invokeMethod(spec.plugin, "isInitialized", - Qt::DirectConnection, Q_RETURN_ARG(bool, isInitialized)); - QVERIFY(!isInitialized); - QVERIFY(spec.initializePlugin()); - QCOMPARE(spec.state, PluginSpec::Initialized); - QVERIFY(!spec.hasError); - QMetaObject::invokeMethod(spec.plugin, "isInitialized", - Qt::DirectConnection, Q_RETURN_ARG(bool, isInitialized)); - QVERIFY(isInitialized); -} - -void tst_PluginSpec::initializeExtensions() -{ - Internal::PluginSpecPrivate spec(0); - QVERIFY(spec.read("testplugin/testplugin.xml")); - QVERIFY(spec.resolveDependencies(QList<PluginSpec *>())); - QVERIFY(spec.loadLibrary()); - bool isExtensionsInitialized; - QVERIFY(spec.initializePlugin()); - QMetaObject::invokeMethod(spec.plugin, "isExtensionsInitialized", - Qt::DirectConnection, Q_RETURN_ARG(bool, isExtensionsInitialized)); - QVERIFY(!isExtensionsInitialized); - QVERIFY(spec.initializeExtensions()); - QCOMPARE(spec.state, PluginSpec::Running); - QVERIFY(!spec.hasError); - QMetaObject::invokeMethod(spec.plugin, "isExtensionsInitialized", - Qt::DirectConnection, Q_RETURN_ARG(bool, isExtensionsInitialized)); - QVERIFY(isExtensionsInitialized); -} - -QTEST_MAIN(tst_PluginSpec) - -#include "tst_pluginspec.moc" diff --git a/src/libs/extensionsystem/test/extensionsystem_test.pri b/src/libs/extensionsystem/test/extensionsystem_test.pri deleted file mode 100644 index a3a33c36d2..0000000000 --- a/src/libs/extensionsystem/test/extensionsystem_test.pri +++ /dev/null @@ -1,27 +0,0 @@ -RELATIVEPATH = $$RELATIVEPATH/../../../.. -INCLUDEPATH *= $$PWD/../.. -macx { - LIBS += -L"$$OUT_PWD/$$RELATIVEPATH/bin/Qt Creator.app/Contents/PlugIns" -} -else { - LIBS += $$OUT_PWD/$$RELATIVEPATH/lib -} - -# stolen from qtcreator.pri -defineReplace(qtLibraryName) { - unset(LIBRARY_NAME) - LIBRARY_NAME = $$1 - CONFIG(debug, debug|release) { - !debug_and_release|build_pass { - mac:RET = $$member(LIBRARY_NAME, 0)_debug - else:win32:RET = $$member(LIBRARY_NAME, 0)d - } - } - isEmpty(RET):RET = $$LIBRARY_NAME - return($$RET) -} - -include(../extensionsystem.pri) - -QT *= xml - |