diff options
Diffstat (limited to 'tests')
68 files changed, 1542 insertions, 1028 deletions
diff --git a/tests/auto/installer/binaryformat/binaryformat.pro b/tests/auto/installer/binaryformat/binaryformat.pro index 24a7899ce..c624b60fa 100644 --- a/tests/auto/installer/binaryformat/binaryformat.pro +++ b/tests/auto/installer/binaryformat/binaryformat.pro @@ -1,5 +1,6 @@ include(../../qttest.pri) QT -= gui +QT += xml SOURCES += tst_binaryformat.cpp diff --git a/tests/auto/installer/binaryformat/tst_binaryformat.cpp b/tests/auto/installer/binaryformat/tst_binaryformat.cpp index 59f0e8e03..b3025b87b 100644 --- a/tests/auto/installer/binaryformat/tst_binaryformat.cpp +++ b/tests/auto/installer/binaryformat/tst_binaryformat.cpp @@ -16,32 +16,27 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** **************************************************************************/ +#include <binarycontent.h> #include <binaryformat.h> #include <errors.h> -#include <fileutils.h> +#include <fileio.h> +#include <kdupdaterupdateoperation.h> #include <QTest> #include <QTemporaryFile> @@ -50,11 +45,45 @@ static const qint64 scTinySize = 72704LL; static const qint64 scSmallSize = 524288LL; static const qint64 scLargeSize = 2097152LL; +using namespace QInstaller; + +struct Layout : public QInstaller::BinaryLayout +{ + qint64 metaSegmentsCount; + qint64 operationsCount; + qint64 collectionCount; +}; + +class TestOperation : public KDUpdater::UpdateOperation +{ +public: + TestOperation(const QString &name) { setName(name); } + + virtual void backup() {} + virtual bool performOperation() { return true; } + virtual bool undoOperation() { return true; } + virtual bool testOperation() { return true; } + virtual KDUpdater::UpdateOperation *clone() const { return 0; } +}; + class tst_BinaryFormat : public QObject { Q_OBJECT private slots: + void initTestCase() + { + TestOperation op(QLatin1String("Operation 1")); + op.setValue(QLatin1String("key"), QLatin1String("Operation 1 value.")); + op.setArguments(QStringList() << QLatin1String("arg1") << QLatin1String("arg2")); + m_operations.append(OperationBlob(op.name(), op.toXml().toString())); + + op = TestOperation(QLatin1String("Operation 2")); + op.setValue(QLatin1String("key"), QLatin1String("Operation 2 value.")); + op.setArguments(QStringList() << QLatin1String("arg1") << QLatin1String("arg2")); + m_operations.append(OperationBlob(op.name(), op.toXml().toString())); + } + void findMagicCookieSmallFile() { QTemporaryFile file; @@ -62,9 +91,10 @@ private slots: try { QInstaller::blockingWrite(&file, QByteArray(scSmallSize, '1')); - QInstaller::appendInt64(&file, QInstaller::MagicCookie); + QInstaller::appendInt64(&file, QInstaller::BinaryContent::MagicCookie); - QCOMPARE(QInstaller::findMagicCookie(&file, QInstaller::MagicCookie), scSmallSize); + QCOMPARE(QInstaller::BinaryContent::findMagicCookie(&file, + QInstaller::BinaryContent::MagicCookie), scSmallSize); } catch (const QInstaller::Error &error) { QFAIL(qPrintable(error.message())); } catch (...) { @@ -79,10 +109,11 @@ private slots: try { QInstaller::blockingWrite(&file, QByteArray(scLargeSize, '1')); - QInstaller::appendInt64(&file, QInstaller::MagicCookie); + QInstaller::appendInt64(&file, QInstaller::BinaryContent::MagicCookie); QInstaller::blockingWrite(&file, QByteArray(scTinySize, '2')); - QCOMPARE(QInstaller::findMagicCookie(&file, QInstaller::MagicCookie), scLargeSize); + QCOMPARE(QInstaller::BinaryContent::findMagicCookie(&file, + QInstaller::BinaryContent::MagicCookie), scLargeSize); } catch (const QInstaller::Error &error) { QFAIL(qPrintable(error.message())); } catch (...) { @@ -90,7 +121,7 @@ private slots: } } - void testFindMagicCookieWithError() + void findMagicCookieWithError() { QTest::ignoreMessage(QtDebugMsg, "create Error-Exception: \"No marker found, stopped after 71.00 KiB.\" "); @@ -101,13 +132,283 @@ private slots: QInstaller::blockingWrite(&file, QByteArray(scTinySize, '1')); // throws - QInstaller::findMagicCookie(&file, QInstaller::MagicCookie); + QInstaller::BinaryContent::findMagicCookie(&file, QInstaller::BinaryContent::MagicCookie); } catch (const QInstaller::Error &error) { QCOMPARE(qPrintable(error.message()), "No marker found, stopped after 71.00 KiB."); } catch (...) { QFAIL("Unexpected error."); } } + + void writeBinaryContent() + { + QTemporaryFile binary; + QInstaller::openForWrite(&binary); + QInstaller::blockingWrite(&binary, QByteArray(scTinySize, '1')); + + Layout layout; + layout.endOfExectuable = binary.pos(); + layout.magicMarker = BinaryContent::MagicInstallerMarker; + layout.magicCookie = BinaryContent::MagicCookie; + + qint64 start = binary.pos(); // write default resource (fake) + QInstaller::blockingWrite(&binary, QByteArray("Default resource data.")); + qint64 end = binary.pos(); + layout.metaResourceSegments.append(Range<qint64>::fromStartAndEnd(start, end)); + + start = end; // // write additional resource (fake) + QInstaller::blockingWrite(&binary, QByteArray("Additional resource data.")); + end = binary.pos(); + layout.metaResourceSegments.append(Range<qint64>::fromStartAndEnd(start, end)); + layout.metaResourcesSegment = Range<qint64>::fromStartAndEnd(layout.metaResourceSegments + .first().start(), layout.metaResourceSegments.last().end()); + layout.metaSegmentsCount = layout.metaResourceSegments.count(); + + start = end; + layout.operationsCount = m_operations.count(); + QInstaller::appendInt64(&binary, layout.operationsCount); + foreach (const OperationBlob &operation, m_operations) { + QInstaller::appendString(&binary, operation.name); + QInstaller::appendString(&binary, operation.xml); + } + QInstaller::appendInt64(&binary, layout.operationsCount); + end = binary.pos(); + layout.operationsSegment = Range<qint64>::fromStartAndEnd(start, end); + + QTemporaryFile data; + QInstaller::openForWrite(&data); + QInstaller::blockingWrite(&data, QByteArray("Collection 1, Resource 1.")); + data.close(); + + QSharedPointer<Resource> resource(new Resource(data.fileName(), QByteArray("Resource 1"))); + ResourceCollection collection(QByteArray("Collection 1")); + collection.appendResource(resource); + + QTemporaryFile data2; + QInstaller::openForWrite(&data2); + QInstaller::blockingWrite(&data2, QByteArray("Collection 2, Resource 2.")); + data2.close(); + + QSharedPointer<Resource> resource2(new Resource(data2.fileName(), QByteArray("Resource 2"))); + ResourceCollection collection2(QByteArray("Collection 2")); + collection2.appendResource(resource2); + + ResourceCollectionManager manager; + manager.insertCollection(collection); + manager.insertCollection(collection2); + + layout.collectionCount = manager.collectionCount(); + layout.resourceCollectionsSegment = manager.write(&binary, -layout.endOfExectuable); + + QInstaller::appendInt64Range(&binary, layout.resourceCollectionsSegment.moved(-layout + .endOfExectuable)); + + foreach (const Range<qint64> &segment, layout.metaResourceSegments) + QInstaller::appendInt64Range(&binary, segment.moved(-layout.endOfExectuable)); + + QInstaller::appendInt64Range(&binary, layout.operationsSegment.moved(-layout + .endOfExectuable)); + + QInstaller::appendInt64(&binary, layout.metaSegmentsCount); + layout.binaryContentSize = (binary.pos() + (3 * sizeof(qint64))) - layout.endOfExectuable; + + QInstaller::appendInt64(&binary, layout.binaryContentSize); + QInstaller::appendInt64(&binary, layout.magicMarker); + QInstaller::appendInt64(&binary, layout.magicCookie); + + layout.endOfBinaryContent = binary.pos(); + + binary.close(); + binary.setAutoRemove(false); + + m_layout = layout; + m_binary = binary.fileName(); + } + + void readBinaryContent() + { + QFile binary(m_binary); + QInstaller::openForRead(&binary); + QCOMPARE(QInstaller::retrieveData(&binary, scTinySize), QByteArray(scTinySize, '1')); + + Layout layout; + layout.endOfExectuable = binary.pos(); + QCOMPARE(layout.endOfExectuable, m_layout.endOfExectuable); + + const qint64 pos = BinaryContent::findMagicCookie(&binary, BinaryContent::MagicCookie); + layout.endOfBinaryContent = pos + sizeof(qint64); + QCOMPARE(layout.endOfBinaryContent, m_layout.endOfBinaryContent); + + binary.seek(layout.endOfBinaryContent - (4 * sizeof(qint64))); + + layout.metaSegmentsCount = QInstaller::retrieveInt64(&binary); + QCOMPARE(layout.metaSegmentsCount, m_layout.metaSegmentsCount); + + const qint64 offsetCollectionIndexSegments = layout.endOfBinaryContent + - ((layout.metaSegmentsCount * (2 * sizeof(qint64))) // minus size of the meta segments + + (8 * sizeof(qint64))); // meta count, offset/length collection index, marker, cookie... + + binary.seek(offsetCollectionIndexSegments); + + layout.resourceCollectionsSegment = QInstaller::retrieveInt64Range(&binary) + .moved(layout.endOfExectuable); + QCOMPARE(layout.resourceCollectionsSegment, m_layout.resourceCollectionsSegment); + + for (int i = 0; i < layout.metaSegmentsCount; ++i) { + layout.metaResourceSegments.append(QInstaller::retrieveInt64Range(&binary) + .moved(layout.endOfExectuable)); + } + layout.metaResourcesSegment = Range<qint64>::fromStartAndEnd(layout.metaResourceSegments + .first().start(), layout.metaResourceSegments.last().end()); + + QCOMPARE(layout.metaResourcesSegment, m_layout.metaResourcesSegment); + QCOMPARE(layout.metaResourceSegments.first(), m_layout.metaResourceSegments.first()); + QCOMPARE(layout.metaResourceSegments.last(), m_layout.metaResourceSegments.last()); + + layout.operationsSegment = QInstaller::retrieveInt64Range(&binary).moved(layout + .endOfExectuable); + QCOMPARE(layout.operationsSegment, m_layout.operationsSegment); + + QCOMPARE(layout.metaSegmentsCount, QInstaller::retrieveInt64(&binary)); + + layout.binaryContentSize = QInstaller::retrieveInt64(&binary); + QCOMPARE(layout.binaryContentSize, m_layout.binaryContentSize); + QCOMPARE(layout.endOfExectuable, layout.endOfBinaryContent - layout.binaryContentSize); + + layout.magicMarker = QInstaller::retrieveInt64(&binary); + QCOMPARE(layout.magicMarker, m_layout.magicMarker); + + layout.magicCookie = QInstaller::retrieveInt64(&binary); + QCOMPARE(layout.magicCookie, m_layout.magicCookie); + + binary.seek(layout.operationsSegment.start()); + + layout.operationsCount = QInstaller::retrieveInt64(&binary); + QCOMPARE(layout.operationsCount, m_layout.operationsCount); + + for (int i = 0; i < layout.operationsCount; ++i) { + QCOMPARE(m_operations.at(i).name, QInstaller::retrieveString(&binary)); + QCOMPARE(m_operations.at(i).xml, QInstaller::retrieveString(&binary)); + } + + layout.operationsCount = QInstaller::retrieveInt64(&binary); + QCOMPARE(layout.operationsCount, m_layout.operationsCount); + + layout.collectionCount = QInstaller::retrieveInt64(&binary); + QCOMPARE(layout.collectionCount, m_layout.collectionCount); + + binary.seek(layout.resourceCollectionsSegment.start()); + m_manager.read(&binary, layout.endOfExectuable); + + const QList<ResourceCollection> collections = m_manager.collections(); + QCOMPARE(collections.count(), m_layout.collectionCount); + + ResourceCollection collection = m_manager.collectionByName(QByteArray("Collection 1")); + QCOMPARE(collection.resources().count(), 1); + + QSharedPointer<Resource> resource(collection.resourceByName(QByteArray("Resource 1"))); + QCOMPARE(resource.isNull(), false); + QCOMPARE(resource->isOpen(), false); + QCOMPARE(resource->open(), true); + QCOMPARE(resource->readAll(), QByteArray("Collection 1, Resource 1.")); + resource->close(); + + collection = m_manager.collectionByName(QByteArray("Collection 2")); + QCOMPARE(collection.resources().count(), 1); + + resource = collection.resourceByName(QByteArray("Resource 2")); + QCOMPARE(resource.isNull(), false); + QCOMPARE(resource->isOpen(), false); + QCOMPARE(resource->open(), true); + QCOMPARE(resource->readAll(), QByteArray("Collection 2, Resource 2.")); + resource->close(); + } + + void testWriteBinaryContentFunction() + { + ResourceCollection collection(QByteArray("QResources")); + foreach (const Range<qint64> &segment, m_layout.metaResourceSegments) + collection.appendResource(QSharedPointer<Resource>(new Resource(m_binary, segment))); + m_manager.insertCollection(collection); + + QList<OperationBlob> operations; + foreach (const OperationBlob &operation, m_operations) + operations.append(operation); + + QTemporaryFile file; + QInstaller::openForWrite(&file); + + QInstaller::blockingWrite(&file, QByteArray(scTinySize, '1')); + BinaryContent::writeBinaryContent(&file, operations, m_manager, m_layout.magicMarker, + m_layout.magicCookie); + file.close(); + + QFile existingBinary(m_binary); + QInstaller::openForRead(&existingBinary); + + QInstaller::openForRead(&file); + QCOMPARE(file.readAll(), existingBinary.readAll()); + } + + void testReadBinaryContentFunction() + { + QFile file(m_binary); + QInstaller::openForRead(&file); + + qint64 magicMarker; + QList<OperationBlob> operations; + ResourceCollectionManager manager; + BinaryContent::readBinaryContent(&file, &operations, &manager, &magicMarker, + m_layout.magicCookie); + file.close(); + + QCOMPARE(magicMarker, m_layout.magicMarker); + + ResourceCollection collection = manager.collectionByName("QResources"); + QCOMPARE(collection.resources().count(), m_layout.metaResourceSegments.count()); + for (int i = 0; i < collection.resources().count(); ++i) + QCOMPARE(collection.resources().at(i)->segment(), m_layout.metaResourceSegments.at(i)); + + QCOMPARE(operations.count(), m_operations.count()); + for (int i = 0; i < operations.count(); ++i) { + QCOMPARE(operations.at(i).name, m_operations.at(i).name); + QCOMPARE(operations.at(i).xml, m_operations.at(i).xml); + } + + QCOMPARE(manager.collectionCount(), m_manager.collectionCount()); + + collection = manager.collectionByName(QByteArray("Collection 1")); + QCOMPARE(collection.resources().count(), 1); + + QSharedPointer<Resource> resource(collection.resourceByName(QByteArray("Resource 1"))); + QCOMPARE(resource.isNull(), false); + QCOMPARE(resource->isOpen(), false); + QCOMPARE(resource->open(), true); + QCOMPARE(resource->readAll(), QByteArray("Collection 1, Resource 1.")); + resource->close(); + + collection = manager.collectionByName(QByteArray("Collection 2")); + QCOMPARE(collection.resources().count(), 1); + + resource = collection.resourceByName(QByteArray("Resource 2")); + QCOMPARE(resource.isNull(), false); + QCOMPARE(resource->isOpen(), false); + QCOMPARE(resource->open(), true); + QCOMPARE(resource->readAll(), QByteArray("Collection 2, Resource 2.")); + resource->close(); + } + + void cleanupTestCase() + { + m_manager.clear(); + QFile::remove(m_binary); + } + +private: + Layout m_layout; + QString m_binary; + QList<OperationBlob> m_operations; + ResourceCollectionManager m_manager; }; QTEST_MAIN(tst_BinaryFormat) diff --git a/tests/auto/installer/clientserver/clientserver.pro b/tests/auto/installer/clientserver/clientserver.pro new file mode 100644 index 000000000..9479f3652 --- /dev/null +++ b/tests/auto/installer/clientserver/clientserver.pro @@ -0,0 +1,6 @@ +include(../../qttest.pri) + +QT += network +QT -= gui + +SOURCES += tst_clientserver.cpp diff --git a/tests/auto/installer/clientserver/tst_clientserver.cpp b/tests/auto/installer/clientserver/tst_clientserver.cpp new file mode 100644 index 000000000..7b1764285 --- /dev/null +++ b/tests/auto/installer/clientserver/tst_clientserver.cpp @@ -0,0 +1,326 @@ +/************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Installer Framework. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** +** $QT_END_LICENSE$ +** +**************************************************************************/ + +#include <protocol.h> +#include <qprocesswrapper.h> +#include <qsettingswrapper.h> +#include <remoteclient.h> +#include <remotefileengine.h> +#include <remoteserver.h> + +#include <QHostAddress> +#include <QSettings> +#include <QTcpSocket> +#include <QTemporaryFile> +#include <QTest> +#include <QSignalSpy> + +using namespace QInstaller; + +class tst_ClientServer : public QObject +{ + Q_OBJECT + +private slots: + void testServerConnection() + { + RemoteServer server; + server.init(39999, QHostAddress::LocalHost, Protocol::Mode::Debug); + server.start(); + + QTcpSocket socket; + socket.connectToHost(QHostAddress::LocalHost, 39999); + QVERIFY2(socket.waitForConnected(), "Could not connect to server."); + } + + void testClientConnection() + { + RemoteServer server; + server.init(39999, QHostAddress::LocalHost, Protocol::Mode::Debug); + server.start(); + + QTcpSocket socket; + RemoteClient::instance().init(39999, QHostAddress::LocalHost, Protocol::Mode::Debug); + QVERIFY2(RemoteClient::instance().connect(&socket), "Could not connect to server."); + } + + void testQSettingsWrapper() + { + RemoteServer server; + server.init(39999, QHostAddress::LocalHost, Protocol::Mode::Debug); + server.start(); + + QSettingsWrapper wrapper("digia", "clientserver"); + QCOMPARE(wrapper.isConnectedToServer(), false); + wrapper.clear(); + QCOMPARE(wrapper.isConnectedToServer(), true); + wrapper.sync(); + wrapper.setFallbacksEnabled(false); + + QSettings settings("digia", "clientserver"); + settings.setFallbacksEnabled(false); + + QCOMPARE(settings.fileName(), wrapper.fileName()); + QCOMPARE(int(settings.format()), int(wrapper.format())); + QCOMPARE(int(settings.scope()), int(wrapper.scope())); + QCOMPARE(settings.organizationName(), wrapper.organizationName()); + QCOMPARE(settings.applicationName(), wrapper.applicationName()); + QCOMPARE(settings.fallbacksEnabled(), wrapper.fallbacksEnabled()); + + wrapper.setValue("key", "value"); + wrapper.setValue("contains", "value"); + wrapper.sync(); + + QCOMPARE(wrapper.value("key").toString(), QLatin1String("value")); + QCOMPARE(settings.value("key").toString(), QLatin1String("value")); + + QCOMPARE(wrapper.contains("contains"), true); + QCOMPARE(settings.contains("contains"), true); + wrapper.remove("contains"); + wrapper.sync(); + QCOMPARE(wrapper.contains("contains"), false); + QCOMPARE(settings.contains("contains"), false); + + wrapper.clear(); + wrapper.sync(); + QCOMPARE(wrapper.contains("key"), false); + QCOMPARE(settings.contains("key"), false); + + wrapper.beginGroup("group"); + wrapper.setValue("key", "value"); + wrapper.endGroup(); + wrapper.sync(); + + wrapper.beginGroup("group"); + settings.beginGroup("group"); + QCOMPARE(wrapper.value("key").toString(), QLatin1String("value")); + QCOMPARE(settings.value("key").toString(), QLatin1String("value")); + QCOMPARE(wrapper.group(), QLatin1String("group")); + QCOMPARE(settings.group(), QLatin1String("group")); + settings.endGroup(); + wrapper.endGroup(); + + wrapper.beginWriteArray("array"); + wrapper.setArrayIndex(0); + wrapper.setValue("key", "value"); + wrapper.endArray(); + wrapper.sync(); + + wrapper.beginReadArray("array"); + settings.beginReadArray("array"); + wrapper.setArrayIndex(0); + settings.setArrayIndex(0); + QCOMPARE(wrapper.value("key").toString(), QLatin1String("value")); + QCOMPARE(settings.value("key").toString(), QLatin1String("value")); + settings.endArray(); + wrapper.endArray(); + + wrapper.setValue("fridge/color", 3); + wrapper.setValue("fridge/size", QSize(32, 96)); + wrapper.setValue("sofa", true); + wrapper.setValue("tv", false); + + wrapper.remove("group"); + wrapper.remove("array"); + wrapper.sync(); + + QStringList keys = wrapper.allKeys(); + QCOMPARE(keys.count(), 4); + QCOMPARE(keys.contains("fridge/color"), true); + QCOMPARE(keys.contains("fridge/size"), true); + QCOMPARE(keys.contains("sofa"), true); + QCOMPARE(keys.contains("tv"), true); + + wrapper.beginGroup("fridge"); + keys = wrapper.allKeys(); + QCOMPARE(keys.count(), 2); + QCOMPARE(keys.contains("color"), true); + QCOMPARE(keys.contains("size"), true); + wrapper.endGroup(); + + keys = wrapper.childKeys(); + QCOMPARE(keys.count(), 2); + QCOMPARE(keys.contains("sofa"), true); + QCOMPARE(keys.contains("tv"), true); + + wrapper.beginGroup("fridge"); + keys = wrapper.childKeys(); + QCOMPARE(keys.count(), 2); + QCOMPARE(keys.contains("color"), true); + QCOMPARE(keys.contains("size"), true); + wrapper.endGroup(); + + QStringList groups = wrapper.childGroups(); + QCOMPARE(groups.count(), 1); + QCOMPARE(groups.contains("fridge"), true); + + wrapper.beginGroup("fridge"); + groups = wrapper.childGroups(); + QCOMPARE(groups.count(), 0); + wrapper.endGroup(); + } + + void testQProcessWrapper() + { + RemoteServer server; + server.init(39999, QHostAddress::LocalHost, Protocol::Mode::Debug); + server.start(); + + { + QProcess process; + QProcessWrapper wrapper; + + QCOMPARE(wrapper.isConnectedToServer(), false); + QCOMPARE(int(wrapper.state()), int(QProcessWrapper::NotRunning)); + QCOMPARE(wrapper.isConnectedToServer(), true); + + QCOMPARE(process.workingDirectory(), wrapper.workingDirectory()); + process.setWorkingDirectory(QDir::tempPath()); + wrapper.setWorkingDirectory(QDir::tempPath()); + QCOMPARE(process.workingDirectory(), wrapper.workingDirectory()); + + QCOMPARE(process.environment(), wrapper.environment()); + process.setEnvironment(QProcess::systemEnvironment()); + wrapper.setEnvironment(QProcess::systemEnvironment()); + QCOMPARE(process.environment(), wrapper.environment()); + + QCOMPARE(int(process.readChannel()), int(wrapper.readChannel())); + process.setReadChannel(QProcess::StandardError); + wrapper.setReadChannel(QProcessWrapper::StandardError); + QCOMPARE(int(process.readChannel()), int(wrapper.readChannel())); + + QCOMPARE(int(process.processChannelMode()), int(wrapper.processChannelMode())); + process.setProcessChannelMode(QProcess::ForwardedChannels); + wrapper.setProcessChannelMode(QProcessWrapper::ForwardedChannels); + QCOMPARE(int(process.processChannelMode()), int(wrapper.processChannelMode())); + } + + { + QProcessWrapper wrapper; + + QCOMPARE(wrapper.isConnectedToServer(), false); + QCOMPARE(int(wrapper.exitCode()), 0); + QCOMPARE(wrapper.isConnectedToServer(), true); + + QCOMPARE(int(wrapper.state()), int(QProcessWrapper::NotRunning)); + QCOMPARE(int(wrapper.exitStatus()), int(QProcessWrapper::NormalExit)); + + QString fileName; + { + QTemporaryFile file(QDir::tempPath() + +#ifdef Q_OS_WIN + QLatin1String("/XXXXXX.bat") +#else + QLatin1String("/XXXXXX.sh") +#endif + ); + file.setAutoRemove(false); + QCOMPARE(file.open(), true); +#ifdef Q_OS_WIN + file.write("@echo off\necho Mega test output!"); +#else + file.write("#!/bin/bash\necho Mega test output!"); +#endif + file.setPermissions(file.permissions() | QFile::ExeOther | QFile::ExeGroup + | QFile::ExeUser); + fileName = file.fileName(); + } + + QSignalSpy spy(&wrapper, SIGNAL(started())); + QSignalSpy spy2(&wrapper, SIGNAL(finished(int))); + QSignalSpy spy3(&wrapper, SIGNAL(finished(int, QProcess::ExitStatus))); + +#ifdef Q_OS_WIN + wrapper.start(fileName); +#else + wrapper.start("sh", QStringList() << fileName); +#endif + QCOMPARE(wrapper.waitForStarted(), true); + QCOMPARE(int(wrapper.state()), int(QProcessWrapper::Running)); + QCOMPARE(wrapper.waitForFinished(), true); + QCOMPARE(int(wrapper.state()), int(QProcessWrapper::NotRunning)); + QCOMPARE(wrapper.readAll().trimmed(), QByteArray("Mega test output!")); + + QTest::qWait(500); + + QCOMPARE(spy.count(), 1); + QCOMPARE(spy2.count(), 1); + QList<QVariant> arguments = spy2.takeFirst(); + QCOMPARE(arguments.first().toInt(), 0); + + QCOMPARE(spy3.count(), 1); + arguments = spy3.takeFirst(); + QCOMPARE(arguments.first().toInt(), 0); + QCOMPARE(arguments.last().toInt(), int(QProcessWrapper::NormalExit)); + + QFile::remove(fileName); + } + } + + void testRemoteFileEngine() + { + RemoteServer server; + server.init(39999, QHostAddress::LocalHost, Protocol::Mode::Debug); + server.start(); + + QString filename; + { + QTemporaryFile file; + file.setAutoRemove(false); + QCOMPARE(file.open(), true); + file.write(QProcess::systemEnvironment().join(QLatin1String("\n")).toLocal8Bit()); + filename = file.fileName(); + } + + RemoteFileEngineHandler handler; + + QFile file; + file.setFileName(filename); + file.open(QIODevice::ReadWrite); + const QByteArray ba = file.readLine(); + file.seek(0); + QCOMPARE(file.atEnd(), false); + + QByteArray ba2(32 * 1024 * 1024, '\0'); + file.readLine(ba2.data(), ba2.size()); + + file.resize(0); + file.write(QProcess::systemEnvironment().join(QLatin1String("\n")).toLocal8Bit()); + QCOMPARE(file.atEnd(), true); + } +}; + +QTEST_MAIN(tst_ClientServer) + +#include "tst_clientserver.moc" diff --git a/tests/auto/installer/componentmodel/componentmodel.pro b/tests/auto/installer/componentmodel/componentmodel.pro index 7e18ff1ba..431969578 100644 --- a/tests/auto/installer/componentmodel/componentmodel.pro +++ b/tests/auto/installer/componentmodel/componentmodel.pro @@ -1,7 +1,7 @@ include(../../qttest.pri) QT -= gui -QT += network xml script +QT += network xml qml SOURCES += tst_componentmodel.cpp diff --git a/tests/auto/installer/consumeoutputoperationtest/consumeoutputoperationtest.pro b/tests/auto/installer/consumeoutputoperationtest/consumeoutputoperationtest.pro index a6fbc60f9..3eacd46ac 100644 --- a/tests/auto/installer/consumeoutputoperationtest/consumeoutputoperationtest.pro +++ b/tests/auto/installer/consumeoutputoperationtest/consumeoutputoperationtest.pro @@ -1,7 +1,7 @@ include(../../qttest.pri) QT -= gui -QT += testlib +QT += testlib qml SOURCES = tst_consumeoutputoperationtest.cpp diff --git a/tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp b/tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp index 227820ed1..538513939 100644 --- a/tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp +++ b/tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** @@ -83,7 +76,7 @@ private slots: QFile orgQmake(QUOTE(QMAKE_BINARY)); // use lrelease filename which will be patched by the QtPatch operation, but it hides that this - // fake Qt contains a qmake which would be used to get the patch pathes (instead of using the qmake + // fake Qt contains a qmake which would be used to get the patch paths (instead of using the qmake // output we want to use our installer value) m_binaryInFakeQt = m_fakeQtPath + "bin" + QDir::separator() + "lrelease" + m_binSuffix; @@ -127,7 +120,7 @@ private slots: return; #if defined(Q_OS_WIN) QString patchType = "windows"; -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_OSX) QString patchType = "mac"; #else QString patchType = "linux"; diff --git a/tests/auto/installer/copyoperationtest/tst_copyoperationtest.cpp b/tests/auto/installer/copyoperationtest/tst_copyoperationtest.cpp index 505d00c53..b7296eb71 100644 --- a/tests/auto/installer/copyoperationtest/tst_copyoperationtest.cpp +++ b/tests/auto/installer/copyoperationtest/tst_copyoperationtest.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** diff --git a/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp b/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp index eb3b0378e..1dd42d225 100644 --- a/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp +++ b/tests/auto/installer/extractarchiveoperationtest/tst_extractarchiveoperationtest.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** diff --git a/tests/auto/installer/fakestopprocessforupdateoperation/fakestopprocessforupdateoperation.pro b/tests/auto/installer/fakestopprocessforupdateoperation/fakestopprocessforupdateoperation.pro index 871b668b2..0c1e6bdfa 100644 --- a/tests/auto/installer/fakestopprocessforupdateoperation/fakestopprocessforupdateoperation.pro +++ b/tests/auto/installer/fakestopprocessforupdateoperation/fakestopprocessforupdateoperation.pro @@ -1,6 +1,6 @@ include(../../qttest.pri) QT -= gui -QT += network script +QT += network qml SOURCES += tst_fakestopprocessforupdateoperation.cpp diff --git a/tests/auto/installer/installer.pro b/tests/auto/installer/installer.pro index c565561b4..0bd5e8690 100644 --- a/tests/auto/installer/installer.pro +++ b/tests/auto/installer/installer.pro @@ -16,4 +16,5 @@ SUBDIRS += \ binaryformat \ packagemanagercore \ settingsoperation \ - task + task \ + clientserver diff --git a/tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp b/tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp index 5b88c0074..f4702e039 100644 --- a/tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp +++ b/tests/auto/installer/lib7zfacade/tst_lib7zfacade.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** @@ -94,11 +87,7 @@ private slots: QVector<Lib7z::File> files = Lib7z::listArchive(&file); QCOMPARE(files.count(), 1); #ifdef Q_OS_UNIX - #if QT_VERSION < 0x050000 - QSKIP("This test requires the time handling to be repaired first.", SkipSingle); - #else QSKIP("This test requires the time handling to be repaired first."); - #endif #endif QCOMPARE(files.first(), m_file); } diff --git a/tests/auto/installer/messageboxhandler/messageboxhandler.pro b/tests/auto/installer/messageboxhandler/messageboxhandler.pro index c0c1364d8..c63b2e35b 100644 --- a/tests/auto/installer/messageboxhandler/messageboxhandler.pro +++ b/tests/auto/installer/messageboxhandler/messageboxhandler.pro @@ -1,6 +1,5 @@ include(../../qttest.pri) -QT += script -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += qml widgets SOURCES += tst_messageboxhandler.cpp diff --git a/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp b/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp index 604b8e0a0..75df29949 100644 --- a/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp +++ b/tests/auto/installer/messageboxhandler/tst_messageboxhandler.cpp @@ -5,7 +5,6 @@ #include <QTest> #include <QMetaEnum> -#include <QScriptEngine> #include <QDebug> #include <stdlib.h> /* srand, rand */ @@ -50,50 +49,42 @@ private slots: void testScriptButtonValues() { PackageManagerCore core; - ScriptEngine scriptEngine(&core); + ScriptEngine *scriptEngine = new ScriptEngine(&core); QMapIterator<QMessageBox::StandardButton, QString> i(m_standardButtonValueMap); while (i.hasNext()) { i.next(); - QString scriptString = QString::fromLatin1("QMessageBox.%1").arg(i.value()); - QScriptValue scriptValue(scriptEngine.evaluate(scriptString)); + const QString scriptString = QString::fromLatin1("QMessageBox.%1").arg(i.value()); + const QJSValue scriptValue = scriptEngine->evaluate(scriptString); + QVERIFY2(!scriptValue.isError(), qPrintable(scriptValue.toString())); QVERIFY2(!scriptValue.isUndefined(), qPrintable( QString::fromLatin1("It seems that %1 is undefined.").arg(scriptString))); - - qint32 evaluatedValue = scriptValue.toInt32(); - QVERIFY2(!scriptEngine.hasUncaughtException(), qPrintable( - QInstaller::uncaughtExceptionString(&scriptEngine))); - - QCOMPARE(static_cast<QMessageBox::StandardButton>(evaluatedValue), i.key()); + QCOMPARE(static_cast<QMessageBox::StandardButton>(scriptValue.toInt()), i.key()); } } void testDefaultAction() { - int standardButtons = QMessageBox::NoButton; - QList<QMessageBox::Button> orderedButtons = MessageBoxHandler::orderedButtons(); - MessageBoxHandler *messageBoxHandler = MessageBoxHandler::instance(); - - messageBoxHandler->setDefaultAction(MessageBoxHandler::Reject); - QString testidentifier(QLatin1String("TestError")); - QString testTitle(QLatin1String("A test error")); - QString testMessage(QLatin1String("This is a test error message.")); + const char ignoreMessage[] = "\"created critical message box TestError: 'A test error', " + "This is a test error message.\" "; + srand(time(0)); /* initialize random seed: */ - const char *ignoreMessage("\"created critical message box TestError: 'A test error', This is a test error message.\" "); - /* initialize random seed: */ - srand(time(0)); + int standardButtons = QMessageBox::NoButton; + MessageBoxHandler::instance()->setDefaultAction(MessageBoxHandler::Reject); + const QList<QMessageBox::Button> orderedButtons = MessageBoxHandler::orderedButtons(); do { standardButtons += QMessageBox::FirstButton; /* generate secret number between 1 and 10: */ - int iSecret = rand() % 10 + 1; + const int iSecret = rand() % 10 + 1; // use only every 5th run to reduce the time which it takes to run this test if (iSecret > 2) continue; + QTest::ignoreMessage(QtDebugMsg, ignoreMessage); - const QMessageBox::StandardButton returnButton = static_cast<QMessageBox::StandardButton>( - messageBoxHandler->critical(testidentifier, testTitle, testMessage, - static_cast<QMessageBox::StandardButton>(standardButtons))); + int returnButton = MessageBoxHandler::instance()->critical(QLatin1String("TestError"), + QLatin1String("A test error"), QLatin1String("This is a test error message."), + static_cast<QMessageBox::StandardButton>(standardButtons)); QMessageBox::StandardButton wantedButton = QMessageBox::NoButton; // find the last button which is the wanted reject button in the current @@ -104,8 +95,7 @@ private slots: } QVERIFY2(wantedButton != QMessageBox::NoButton, "Could not find a wantedButton."); - QCOMPARE(returnButton, wantedButton); - + QCOMPARE(static_cast<QMessageBox::StandardButton>(returnButton), wantedButton); } while (standardButtons < m_maxStandardButtons); } diff --git a/tests/auto/installer/mkdiroperationtest/tst_mkdiroperationtest.cpp b/tests/auto/installer/mkdiroperationtest/tst_mkdiroperationtest.cpp index 8eef8d2b2..7df4bf448 100644 --- a/tests/auto/installer/mkdiroperationtest/tst_mkdiroperationtest.cpp +++ b/tests/auto/installer/mkdiroperationtest/tst_mkdiroperationtest.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** diff --git a/tests/auto/installer/packagemanagercore/packagemanagercore.pro b/tests/auto/installer/packagemanagercore/packagemanagercore.pro index c78393540..6e9e387fa 100644 --- a/tests/auto/installer/packagemanagercore/packagemanagercore.pro +++ b/tests/auto/installer/packagemanagercore/packagemanagercore.pro @@ -1,9 +1,7 @@ include(../../qttest.pri) -QT += script -lessThan(QT_MAJOR_VERSION, 5) { - QT -= gui -} +QT += qml + SOURCES += tst_packagemanagercore.cpp RESOURCES += \ diff --git a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp index 01c56caea..b59afde7c 100644 --- a/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp +++ b/tests/auto/installer/packagemanagercore/tst_packagemanagercore.cpp @@ -16,30 +16,23 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** **************************************************************************/ -#include <binaryformat.h> +#include <binarycontent.h> #include <component.h> #include <errors.h> #include <fileutils.h> @@ -71,6 +64,25 @@ public: } }; +class NamedComponent : public Component +{ +public: + NamedComponent(PackageManagerCore *core, const QString &name) + : Component(core) + { + setValue(scName, name); + setValue(scVersion, QLatin1String("1.0.0")); + } + + NamedComponent(PackageManagerCore *core, const QString &name, const QString &version) + : Component(core) + { + setValue(scName, name); + setValue(scVersion, version); + } + +}; + class tst_PackageManagerCore : public QObject { Q_OBJECT @@ -104,7 +116,8 @@ private slots: setIgnoreMessage(testDirectory); - PackageManagerCore core(MagicInstallerMarker); + PackageManagerCore core(QInstaller::BinaryContent::MagicInstallerMarker, + QList<QInstaller::OperationBlob>()); // cancel the installer in error case core.autoRejectMessageBoxes(); core.appendRootComponent(new DummyComponent(&core)); @@ -132,7 +145,8 @@ private slots: setIgnoreMessage(testDirectory); - PackageManagerCore core(MagicInstallerMarker); + PackageManagerCore core(QInstaller::BinaryContent::MagicInstallerMarker, + QList<QInstaller::OperationBlob>()); // cancel the installer in error case core.autoRejectMessageBoxes(); core.appendRootComponent(new DummyComponent(&core)); @@ -146,6 +160,76 @@ private slots: ProgressCoordinator::instance()->reset(); } + void testComponentSetterGetter() + { + { + PackageManagerCore core; + core.setPackageManager(); + + QCOMPARE(core.components(PackageManagerCore::ComponentType::Root).count(), 0); + QCOMPARE(core.components(PackageManagerCore::ComponentType::All).count(), 0); + + Component *root = new NamedComponent(&core, QLatin1String("root1")); + root->appendComponent(new NamedComponent(&core, QLatin1String("root1.foo"), + QLatin1String("1.0.1"))); + root->appendComponent(new NamedComponent(&core, QLatin1String("root1.bar"))); + core.appendRootComponent(root); + + QCOMPARE(core.components(PackageManagerCore::ComponentType::Root).count(), 1); + QCOMPARE(core.components(PackageManagerCore::ComponentType::All).count(), 3); + + Component *foo = core.componentByName(QLatin1String("root1.foo-1.0.1")); + QVERIFY(foo != 0); + QCOMPARE(foo->name(), QLatin1String("root1.foo")); + QCOMPARE(foo->value(scVersion), QLatin1String("1.0.1")); + + foo->appendComponent(new NamedComponent(&core, QLatin1String("root1.foo.child"))); + Component *v = new NamedComponent(&core, QLatin1String("root1.foo.virtual.child")); + v->setValue(scVirtual, QLatin1String("true")); + foo->appendComponent(v); + + QCOMPARE(core.components(PackageManagerCore::ComponentType::Root).count(), 1); + QCOMPARE(core.components(PackageManagerCore::ComponentType::All).count(), 5); + + core.appendRootComponent(new NamedComponent(&core, QLatin1String("root2"))); + + QCOMPARE(core.components(PackageManagerCore::ComponentType::Root).count(), 2); + QCOMPARE(core.components(PackageManagerCore::ComponentType::All).count(), 6); + } + + { + PackageManagerCore core; + core.setUpdater(); + + Component *root = new NamedComponent(&core, QLatin1String("root1")); + try { + QTest::ignoreMessage(QtDebugMsg, "create Error-Exception: \"Components cannot " + "have children in updater mode.\" "); + root->appendComponent(new NamedComponent(&core, QLatin1String("root1.foo"))); + QFAIL("Components cannot have children in updater mode."); + } catch (const QInstaller::Error &error) { + QCOMPARE(error.message(), QString("Components cannot have children in updater mode.")); + } + core.appendUpdaterComponent(root); + core.appendUpdaterComponent(new NamedComponent(&core, QLatin1String("root2"))); + + Component *v = new NamedComponent(&core, QLatin1String("root3"), QLatin1String("2.0.1")); + v->setValue(scVirtual, QLatin1String("true")); + core.appendUpdaterComponent(v); + + QCOMPARE(core.components(PackageManagerCore::ComponentType::Root).count(), 3); + QCOMPARE(core.components(PackageManagerCore::ComponentType::All).count(), 3); + + Component *root3 = core.componentByName(QLatin1String("root3->2.0.2")); + QVERIFY(root3 == 0); + + root3 = core.componentByName(QLatin1String("root3->2.0.0")); + QVERIFY(root3 != 0); + QCOMPARE(root3->name(), QLatin1String("root3")); + QCOMPARE(root3->value(scVersion), QLatin1String("2.0.1")); + } + } + void testRequiredDiskSpace() { // test installer diff --git a/tests/auto/installer/scriptengine/data/dynamicpage.qs b/tests/auto/installer/scriptengine/data/dynamicpage.qs new file mode 100644 index 000000000..4ac1990c1 --- /dev/null +++ b/tests/auto/installer/scriptengine/data/dynamicpage.qs @@ -0,0 +1,58 @@ +/************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Installer Framework. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** +** $QT_END_LICENSE$ +** +**************************************************************************/ + +function Controller() +{ +} + +Controller.prototype.ReadAndSetValues = function() +{ + var widget = gui.pageWidgetByObjectName("DynamicWidget"); + installer.setValue("DynamicWidget.final", widget.final); + installer.setValue("DynamicWidget.commit", widget.commit); + installer.setValue("DynamicWidget.complete", widget.complete); +} + +Controller.prototype.UpdateAndSetValues = function () +{ + var widget = gui.pageWidgetByObjectName("DynamicWidget"); + + widget.final = false; + widget.commit = false; + widget.complete = true; + + installer.setValue("DynamicWidget.final", widget.final); + installer.setValue("DynamicWidget.commit", widget.commit); + installer.setValue("DynamicWidget.complete", widget.complete); +} diff --git a/tests/auto/installer/scriptengine/scriptengine.pro b/tests/auto/installer/scriptengine/scriptengine.pro index a7b2bd157..71d8196a1 100644 --- a/tests/auto/installer/scriptengine/scriptengine.pro +++ b/tests/auto/installer/scriptengine/scriptengine.pro @@ -1,9 +1,6 @@ include(../../qttest.pri) -QT += script -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets -} +QT += qml widgets SOURCES += tst_scriptengine.cpp diff --git a/tests/auto/installer/scriptengine/scriptengine.qrc b/tests/auto/installer/scriptengine/scriptengine.qrc index 0bf683852..caffe3627 100644 --- a/tests/auto/installer/scriptengine/scriptengine.qrc +++ b/tests/auto/installer/scriptengine/scriptengine.qrc @@ -4,5 +4,6 @@ <file>data/component1.qs</file> <file>data/component2.qs</file> <file>data/broken_connect.qs</file> + <file>data/dynamicpage.qs</file> </qresource> </RCC> diff --git a/tests/auto/installer/scriptengine/tst_scriptengine.cpp b/tests/auto/installer/scriptengine/tst_scriptengine.cpp index 5c67afd0c..d7b7aa4d0 100644 --- a/tests/auto/installer/scriptengine/tst_scriptengine.cpp +++ b/tests/auto/installer/scriptengine/tst_scriptengine.cpp @@ -1,3 +1,37 @@ +/************************************************************************** +** +** Copyright (C) 2013-2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Installer Framework. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** 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 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** +** $QT_END_LICENSE$ +** +**************************************************************************/ + #include <component.h> #include <errors.h> #include <packagemanagercore.h> @@ -32,6 +66,29 @@ public: } }; +class DynamicPageGui : public PackageManagerGui +{ + Q_OBJECT + +public: + explicit DynamicPageGui(PackageManagerCore *core) + : PackageManagerGui(core) + {} + + void init() { + m_widget = new QWidget; + m_widget->setObjectName("Widget"); + + packageManagerCore()->wizardPageInsertionRequested(m_widget, + PackageManagerCore::Introduction); + } + + QWidget *widget() const { return m_widget; } + +private: + QWidget *m_widget; +}; + class EmitSignalObject : public QObject { Q_OBJECT @@ -64,114 +121,146 @@ private slots: m_scriptEngine = m_core.componentScriptEngine(); } + void testDefaultScriptEngineValues() + { + const QJSValue global = m_scriptEngine->globalObject(); + QCOMPARE(global.hasProperty(QLatin1String("print")), true); + + QCOMPARE(global.hasProperty(QLatin1String("installer")), true); + QCOMPARE(global.property(QLatin1String("installer")) + .hasProperty(QLatin1String("componentByName")), true); + QCOMPARE(global.property(QLatin1String("installer")) + .hasProperty(QLatin1String("components")), true); + + QCOMPARE(global.hasProperty(QLatin1String("console")), true); + QCOMPARE(global.property(QLatin1String("console")) + .hasProperty(QLatin1String("log")), true); + + QCOMPARE(global.hasProperty(QLatin1String("QFileDialog")), true); + QCOMPARE(global.property(QLatin1String("QFileDialog")) + .hasProperty(QLatin1String("getExistingDirectory")), true); + QCOMPARE(global.property(QLatin1String("QFileDialog")) + .hasProperty(QLatin1String("getOpenFileName")), true); + + QCOMPARE(global.hasProperty(QLatin1String("InstallerProxy")), true); + QCOMPARE(global.property(QLatin1String("InstallerProxy")) + .hasProperty(QLatin1String("componentByName")), true); + + QCOMPARE(global.hasProperty(QLatin1String("QDesktopServices")), true); + QCOMPARE(global.property(QLatin1String("QDesktopServices")) + .hasProperty(QLatin1String("openUrl")), true); + QCOMPARE(global.property(QLatin1String("QDesktopServices")) + .hasProperty(QLatin1String("displayName")), true); + QCOMPARE(global.property(QLatin1String("QDesktopServices")) + .hasProperty(QLatin1String("storageLocation")), true); + + QCOMPARE(global.hasProperty(QLatin1String("buttons")), true); + QCOMPARE(global.hasProperty(QLatin1String("QInstaller")), true); + QCOMPARE(global.hasProperty(QLatin1String("QMessageBox")), true); + + QCOMPARE(global.hasProperty(QLatin1String("gui")), true); + QCOMPARE(global.hasProperty(QLatin1String("qsTr")), true); + } + void testBrokenJSMethodConnect() { EmitSignalObject emiter; m_scriptEngine->globalObject().setProperty(QLatin1String("emiter"), m_scriptEngine->newQObject(&emiter)); - QScriptValue context = m_scriptEngine->loadInConext(QLatin1String("BrokenConnect"), + QJSValue context = m_scriptEngine->loadInContext(QLatin1String("BrokenConnect"), ":///data/broken_connect.qs"); - QVERIFY(context.isValid()); - - if (m_scriptEngine->hasUncaughtException()) { - QFAIL(qPrintable(QString::fromLatin1("ScriptEngine hasUncaughtException:\n %1").arg( - uncaughtExceptionString(m_scriptEngine)))); + if (context.isError()) { + QFAIL(qPrintable(QString::fromLatin1("ScriptEngine error:\n %1").arg( + context.toString()))); } + QCOMPARE(context.isError(), false); - const QString debugMesssage( - "create Error-Exception: \"Fatal error while evaluating a script.\n\n" - "ReferenceError: Can't find variable: foo\n\n" - "Backtrace:\n" -#if QT_VERSION < 0x050000 - "\t<anonymous>()@:///data/broken_connect.qs:10\" "); -#else - "\treceive() at :///data/broken_connect.qs:10\n" - "\t<global>() at -1\" "); -#endif - try { - // ignore Output from script - setExpectedScriptOutput("function receive()"); - setExpectedScriptOutput(qPrintable(debugMesssage)); - emiter.produceSignal(); - } catch (const Error &error) { - QVERIFY2(debugMesssage.contains(error.message()), "There was some unexpected error."); - } + // ignore Output from script + setExpectedScriptOutput("\"function receive()\""); + + emiter.produceSignal(); + + const QJSValue value = m_scriptEngine->evaluate(""); + QCOMPARE(value.isError(), true); + QCOMPARE(value.toString(), QLatin1String("ReferenceError: foo is not defined")); } void testScriptPrint() { - setExpectedScriptOutput("test"); - m_scriptEngine->evaluate("print(\"test\");"); - if (m_scriptEngine->hasUncaughtException()) { - QFAIL(qPrintable(QString::fromLatin1("ScriptEngine hasUncaughtException:\n %1").arg( - uncaughtExceptionString(m_scriptEngine)))); + setExpectedScriptOutput("\"test\""); + const QJSValue value = m_scriptEngine->evaluate("print(\"test\");"); + if (value.isError()) { + QFAIL(qPrintable(QString::fromLatin1("ScriptEngine error:\n %1").arg( + value.toString()))); } } void testExistingInstallerObject() { - setExpectedScriptOutput("object"); - m_scriptEngine->evaluate("print(typeof installer)"); - if (m_scriptEngine->hasUncaughtException()) { - QFAIL(qPrintable(QString::fromLatin1("ScriptEngine hasUncaughtException:\n %1").arg( - uncaughtExceptionString(m_scriptEngine)))); + setExpectedScriptOutput("\"object\""); + const QJSValue value = m_scriptEngine->evaluate("print(typeof installer)"); + if (value.isError()) { + QFAIL(qPrintable(QString::fromLatin1("ScriptEngine error:\n %1").arg( + value.toString()))); } } void testComponentByName() { - const QString printComponentNameScript = QString::fromLatin1("var correctComponent = " - "installer.componentByName('%1');\nprint(correctComponent.name);").arg(m_component->name()); - - setExpectedScriptOutput("component.test.name"); - m_scriptEngine->evaluate(printComponentNameScript); - if (m_scriptEngine->hasUncaughtException()) { - QFAIL(qPrintable(QString::fromLatin1("ScriptEngine hasUncaughtException:\n %1").arg( - uncaughtExceptionString(m_scriptEngine)))); + const QString script = QString::fromLatin1("var component = installer.componentByName('%1');" + "\n" + "print(component.name);").arg(m_component->name()); + + setExpectedScriptOutput("\"component.test.name\""); + const QJSValue value = m_scriptEngine->evaluate(script); + if (value.isError()) { + QFAIL(qPrintable(QString::fromLatin1("ScriptEngine error:\n %1").arg( + value.toString()))); } } void testComponentByWrongName() { - const QString printComponentNameScript = QString::fromLatin1( "var brokenComponent = " - "installer.componentByName('%1');\nprint(brokenComponent.name);").arg("MyNotExistingComponentName"); + const QString script = QString::fromLatin1( "var component = installer.componentByName('%1');" + "\n" + "print(brokenComponent.name);").arg("NotExistingComponentName"); - m_scriptEngine->evaluate(printComponentNameScript); - QVERIFY(m_scriptEngine->hasUncaughtException()); + const QJSValue value = m_scriptEngine->evaluate(script); + QCOMPARE(value.isError(), true); } void loadSimpleComponentScript() { try { // ignore retranslateUi which is called by loadComponentScript - setExpectedScriptOutput("Component constructor - OK"); - setExpectedScriptOutput("retranslateUi - OK"); + setExpectedScriptOutput("\"Component constructor - OK\""); + setExpectedScriptOutput("\"retranslateUi - OK\""); m_component->loadComponentScript(":///data/component1.qs"); - setExpectedScriptOutput("retranslateUi - OK"); + setExpectedScriptOutput("\"retranslateUi - OK\""); m_component->languageChanged(); - setExpectedScriptOutput("createOperationsForPath - OK"); + setExpectedScriptOutput("\"createOperationsForPath - OK\""); m_component->createOperationsForPath(":///data/"); - setExpectedScriptOutput("createOperationsForArchive - OK"); + setExpectedScriptOutput("\"createOperationsForArchive - OK\""); // ignore createOperationsForPath which is called by createOperationsForArchive - setExpectedScriptOutput("createOperationsForPath - OK"); + setExpectedScriptOutput("\"createOperationsForPath - OK\""); m_component->createOperationsForArchive("test.7z"); - setExpectedScriptOutput("beginInstallation - OK"); + setExpectedScriptOutput("\"beginInstallation - OK\""); m_component->beginInstallation(); - setExpectedScriptOutput("createOperations - OK"); + setExpectedScriptOutput("\"createOperations - OK\""); m_component->createOperations(); - setExpectedScriptOutput("isAutoDependOn - OK"); + setExpectedScriptOutput("\"isAutoDependOn - OK\""); bool returnIsAutoDependOn = m_component->isAutoDependOn(QSet<QString>()); QCOMPARE(returnIsAutoDependOn, false); - setExpectedScriptOutput("isDefault - OK"); + setExpectedScriptOutput("\"isDefault - OK\""); bool returnIsDefault = m_component->isDefault(); QCOMPARE(returnIsDefault, false); @@ -185,28 +274,19 @@ private slots: Component *testComponent = new Component(&m_core); testComponent->setValue(scName, "broken.component"); - // now m_core becomes the owner of testComponent - // so it will delete it then at the destuctor + // m_core becomes the owner of testComponent, it will delete it in the destructor m_core.appendRootComponent(testComponent); const QString debugMesssage( - "create Error-Exception: \"Exception while loading the component script: ':///data/component2.qs\n\n" - "ReferenceError: Can't find variable: broken\n\n" - "Backtrace:\n" -#if QT_VERSION < 0x050000 - "\t<anonymous>()@:///data/component2.qs:5'\" "); -#else - "\tComponent() at :///data/component2.qs:5\n" - "\t<anonymous>() at :///data/component2.qs:7\n" - "\t<global>() at :///data/component2.qs:7'\" "); -#endif + "create Error-Exception: \"Exception while loading the component script '" + ":///data/component2.qs'. (ReferenceError: broken is not defined)\""); try { // ignore Output from script - setExpectedScriptOutput("script function: Component"); + setExpectedScriptOutput("\"script function: Component\""); setExpectedScriptOutput(qPrintable(debugMesssage)); testComponent->loadComponentScript(":///data/component2.qs"); } catch (const Error &error) { - QVERIFY2(debugMesssage.contains(error.message()), "There was some unexpected error."); + QVERIFY2(debugMesssage.contains(error.message()), "(ReferenceError: broken is not defined)"); } } @@ -226,13 +306,53 @@ private slots: QTest::ignoreMessage(QtWarningMsg, "Button with type: \"unknown button\" not found! "); testGui.callProtectedDelayedExecuteControlScript(PackageManagerCore::ComponentSelection); - setExpectedScriptOutput("FinishedPageCallback - OK"); + setExpectedScriptOutput("\"FinishedPageCallback - OK\""); testGui.callProtectedDelayedExecuteControlScript(PackageManagerCore::InstallationFinished); } catch (const Error &error) { QFAIL(qPrintable(error.message())); } } + void testDynamicPage() + { + DynamicPageGui gui(&m_core); + gui.init(); + + setExpectedScriptOutput("Loaded control script \":///data/dynamicpage.qs\" "); + gui.loadControlScript(":///data/dynamicpage.qs"); + + gui.callControlScriptMethod("ReadAndSetValues"); + + QCOMPARE(m_core.value("DynamicWidget.final"), QString("false")); + QCOMPARE(gui.widget()->property("final").toString(), QString("false")); + QCOMPARE(m_core.value("DynamicWidget.commit"), QString("false")); + QCOMPARE(gui.widget()->property("commit").toString(), QString("false")); + QCOMPARE(m_core.value("DynamicWidget.complete"), QString("true")); + QCOMPARE(gui.widget()->property("complete").toString(), QString("true")); + + gui.widget()->setProperty("final", true); + gui.widget()->setProperty("commit", true); + gui.widget()->setProperty("complete", false); + + gui.callControlScriptMethod("ReadAndSetValues"); + + QCOMPARE(m_core.value("DynamicWidget.final"), QString("true")); + QCOMPARE(gui.widget()->property("final").toString(), QString("true")); + QCOMPARE(m_core.value("DynamicWidget.commit"), QString("true")); + QCOMPARE(gui.widget()->property("commit").toString(), QString("true")); + QCOMPARE(m_core.value("DynamicWidget.complete"), QString("false")); + QCOMPARE(gui.widget()->property("complete").toString(), QString("false")); + + gui.callControlScriptMethod("UpdateAndSetValues"); + + QCOMPARE(m_core.value("DynamicWidget.final"), QString("false")); + QCOMPARE(gui.widget()->property("final").toString(), QString("false")); + QCOMPARE(m_core.value("DynamicWidget.commit"), QString("false")); + QCOMPARE(gui.widget()->property("commit").toString(), QString("false")); + QCOMPARE(m_core.value("DynamicWidget.complete"), QString("true")); + QCOMPARE(gui.widget()->property("complete").toString(), QString("true")); + } + private: void setExpectedScriptOutput(const char *message) { diff --git a/tests/auto/installer/settings/data/full_config.xml b/tests/auto/installer/settings/data/full_config.xml index 8af96edda..51b63315a 100644 --- a/tests/auto/installer/settings/data/full_config.xml +++ b/tests/auto/installer/settings/data/full_config.xml @@ -11,10 +11,9 @@ File should contain all elements we allow in a config.xml <Publisher>Your vendor</Publisher> <ProductUrl>Your vendor</ProductUrl> - <TargetDir>@homeDir@InstallationDirectory</TargetDir> - <AdminTargetDir>@rootDir@InstallationDirectory</AdminTargetDir> + <TargetDir>@HomeDir@InstallationDirectory</TargetDir> + <AdminTargetDir>@RootDir@InstallationDirectory</AdminTargetDir> - <Icon>icon</Icon> <InstallerApplicationIcon>icon</InstallerApplicationIcon> <InstallerWindowIcon>icon</InstallerWindowIcon> <Logo>logo</Logo> @@ -25,8 +24,8 @@ File should contain all elements we allow in a config.xml <StartMenuDir>Super App</StartMenuDir> - <UninstallerName>uninstaller</UninstallerName> - <UninstallerIniFile>uninstaller.ini</UninstallerIniFile> + <MaintenanceToolName>maintenancetool</MaintenanceToolName> + <MaintenanceToolIniFile>maintenancetool.ini</MaintenanceToolIniFile> <RemoveTargetDir>true</RemoveTargetDir> <RunProgram>myapp</RunProgram> diff --git a/tests/auto/installer/settings/data/malformed_config.xml b/tests/auto/installer/settings/data/malformed_config.xml index ebac3027c..8725caaf9 100644 --- a/tests/auto/installer/settings/data/malformed_config.xml +++ b/tests/auto/installer/settings/data/malformed_config.xml @@ -5,4 +5,4 @@ <Title>Your application Installer</Title> <Publisher>Your vendor</Publisher> <StartMenuDir>Super App</StartMenuDir> - <TargetDir>@rootDir@InstallationDirectory</TargetDir> + <TargetDir>@RootDir@InstallationDirectory</TargetDir> diff --git a/tests/auto/installer/settings/data/minimal_config_tag_defaults.xml b/tests/auto/installer/settings/data/minimal_config_tag_defaults.xml new file mode 100644 index 000000000..041ce5062 --- /dev/null +++ b/tests/auto/installer/settings/data/minimal_config_tag_defaults.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Installer> + <Name>Your application</Name> + <Version>1.2.3</Version> + <MaintenanceToolName></MaintenanceToolName> + <MaintenanceToolIniFile></MaintenanceToolIniFile> + <TargetConfigurationFile></TargetConfigurationFile> +</Installer> diff --git a/tests/auto/installer/settings/data/tutorial_config.xml b/tests/auto/installer/settings/data/tutorial_config.xml index 235434776..6ffb2e3e8 100644 --- a/tests/auto/installer/settings/data/tutorial_config.xml +++ b/tests/auto/installer/settings/data/tutorial_config.xml @@ -5,5 +5,5 @@ <Title>Your application Installer</Title> <Publisher>Your vendor</Publisher> <StartMenuDir>Super App</StartMenuDir> - <TargetDir>@rootDir@InstallationDirectory</TargetDir> + <TargetDir>@RootDir@InstallationDirectory</TargetDir> </Installer> diff --git a/tests/auto/installer/settings/data/unexpectedattribute_config.xml b/tests/auto/installer/settings/data/unexpectedattribute_config.xml new file mode 100644 index 000000000..67cbb4eea --- /dev/null +++ b/tests/auto/installer/settings/data/unexpectedattribute_config.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Installer> + <Name>Your application</Name> + <Version>1.2.3</Version> + <RunProgramArguments> + <Argument foo="bar">Test</Argument> + </RunProgramArguments> +</Installer> diff --git a/tests/auto/installer/settings/data/unexpectedtag_config.xml b/tests/auto/installer/settings/data/unexpectedtag_config.xml new file mode 100644 index 000000000..f8bc87b60 --- /dev/null +++ b/tests/auto/installer/settings/data/unexpectedtag_config.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Installer> + <Name>Your application</Name> + <Version>1.2.3</Version> + <RunProgramArguments> + <Foo>Bar</Foo> + </RunProgramArguments> +</Installer> diff --git a/tests/auto/installer/settings/settings.qrc b/tests/auto/installer/settings/settings.qrc index de130ea10..c86847993 100644 --- a/tests/auto/installer/settings/settings.qrc +++ b/tests/auto/installer/settings/settings.qrc @@ -6,5 +6,8 @@ <file>data/minimal_config.xml</file> <file>data/tutorial_config.xml</file> <file>data/unknown_element_config.xml</file> + <file>data/minimal_config_tag_defaults.xml</file> + <file>data/unexpectedtag_config.xml</file> + <file>data/unexpectedattribute_config.xml</file> </qresource> </RCC> diff --git a/tests/auto/installer/settings/tst_settings.cpp b/tests/auto/installer/settings/tst_settings.cpp index e6ebc6e6e..54d6dc66e 100644 --- a/tests/auto/installer/settings/tst_settings.cpp +++ b/tests/auto/installer/settings/tst_settings.cpp @@ -20,6 +20,9 @@ private slots: void loadMalformedConfig(); void loadUnknownElementConfigInStrictParseMode(); void loadUnknownElementConfigInRelaxedParseMode(); + void loadMinimalConfigTagDefaults(); + void loadUnexpectedAttributeConfig(); + void loadUnexpectedTagConfig(); }; void tst_Settings::loadTutorialConfig() @@ -32,39 +35,40 @@ void tst_Settings::loadTutorialConfig() QCOMPARE(settings.title(), QLatin1String("Your application Installer")); QCOMPARE(settings.publisher(), QLatin1String("Your vendor")); QCOMPARE(settings.startMenuDir(), QLatin1String("Super App")); - QCOMPARE(settings.targetDir(), QLatin1String("@rootDir@InstallationDirectory")); + QCOMPARE(settings.targetDir(), QLatin1String("@RootDir@InstallationDirectory")); // default values - QCOMPARE(settings.logo(), QLatin1String(":///data/")); + QCOMPARE(settings.logo(), QString()); QCOMPARE(settings.url(), QString()); - QCOMPARE(settings.watermark(), QLatin1String(":///data/")); - QCOMPARE(settings.banner(), QLatin1String(":///data/")); - QCOMPARE(settings.background(), QLatin1String(":///data/")); + QCOMPARE(settings.watermark(), QString()); + QCOMPARE(settings.banner(), QString()); + QCOMPARE(settings.background(), QString()); #if defined(Q_OS_WIN) - QCOMPARE(settings.icon(), QLatin1String(":/installer.ico")); QCOMPARE(settings.installerApplicationIcon(), QLatin1String(":/installer.ico")); QCOMPARE(settings.installerWindowIcon(), QLatin1String(":/installer.ico")); -#elif defined(Q_OS_MAC) - QCOMPARE(settings.icon(), QLatin1String(":/installer.icns")); + QCOMPARE(settings.systemIconSuffix(), QLatin1String(".ico")); +#elif defined(Q_OS_OSX) QCOMPARE(settings.installerApplicationIcon(), QLatin1String(":/installer.icns")); QCOMPARE(settings.installerWindowIcon(), QLatin1String(":/installer.icns")); + QCOMPARE(settings.systemIconSuffix(), QLatin1String(".icns")); #else - QCOMPARE(settings.icon(), QLatin1String(":/installer.png")); QCOMPARE(settings.installerApplicationIcon(), QLatin1String(":/installer.png")); QCOMPARE(settings.installerWindowIcon(), QLatin1String(":/installer.png")); + QCOMPARE(settings.systemIconSuffix(), QLatin1String(".png")); #endif + QCOMPARE(settings.wizardStyle(), QString()); + QCOMPARE(settings.titleColor(), QString()); QCOMPARE(settings.runProgram(), QString()); - QCOMPARE(settings.runProgramArguments(), QString()); + QCOMPARE(settings.runProgramArguments(), QStringList()); QCOMPARE(settings.runProgramDescription(), QString()); QCOMPARE(settings.adminTargetDir(), QString()); QCOMPARE(settings.removeTargetDir(), QLatin1String("true")); - QCOMPARE(settings.uninstallerName(), QLatin1String("uninstall")); - QCOMPARE(settings.uninstallerIniFile(), QLatin1String("uninstall.ini")); + QCOMPARE(settings.maintenanceToolName(), QLatin1String("maintenancetool")); + QCOMPARE(settings.maintenanceToolIniFile(), QLatin1String("maintenancetool.ini")); QCOMPARE(settings.configurationFileName(), QLatin1String("components.xml")); QCOMPARE(settings.dependsOnLocalInstallerBinary(), false); QCOMPARE(settings.repositorySettingsPageVisible(), true); - QCOMPARE(settings.hasReplacementRepos(), false); - QCOMPARE(settings.allowSpaceInPath(), false); + QCOMPARE(settings.allowSpaceInPath(), true); QCOMPARE(settings.allowNonAsciiCharacters(), false); QCOMPARE(settings.hasReplacementRepos(), false); @@ -82,7 +86,6 @@ void tst_Settings::loadTutorialConfig() void tst_Settings::loadFullConfig() { - QTest::ignoreMessage(QtWarningMsg, "Deprecated element 'Icon'. "); Settings settings = Settings::fromFileAndPrefix(":///data/full_config.xml", ":///data"); } @@ -156,6 +159,54 @@ void tst_Settings::loadUnknownElementConfigInRelaxedParseMode() } } +void tst_Settings::loadMinimalConfigTagDefaults() +{ + Settings settings = Settings::fromFileAndPrefix(":///data/minimal_config_tag_defaults.xml", + ":///data"); + + // These tags are not mandatory, though need to be set to default values. + QCOMPARE(settings.configurationFileName(), QLatin1String("components.xml")); + + QCOMPARE(settings.maintenanceToolName(), QLatin1String("maintenancetool")); + QCOMPARE(settings.maintenanceToolIniFile(), QLatin1String("maintenancetool.ini")); +} + +void tst_Settings::loadUnexpectedAttributeConfig() +{ + QTest::ignoreMessage(QtDebugMsg, "create Error-Exception: \"Error in " + ":///data/unexpectedattribute_config.xml, line 6, column 27: Unexpected attribute " + "for element 'Argument'.\" "); + + try { + Settings::fromFileAndPrefix(":///data/unexpectedattribute_config.xml", ":///data"); + } catch (const Error &error) { + QCOMPARE(error.message(), QLatin1String("Error in :///data/unexpectedattribute_config.xml," + " line 6, column 27: Unexpected attribute for element 'Argument'.")); + return; + } + QFAIL("No exception thrown"); + + return; +} + +void tst_Settings::loadUnexpectedTagConfig() +{ + QTest::ignoreMessage(QtDebugMsg, "create Error-Exception: \"Error in " + ":///data/unexpectedtag_config.xml, line 6, column 12: Unexpected element 'Foo'.\" "); + + try { + Settings::fromFileAndPrefix(":///data/unexpectedtag_config.xml", ":///data"); + } catch (const Error &error) { + QCOMPARE(error.message(), QLatin1String("Error in :///data/unexpectedtag_config.xml," + " line 6, column 12: Unexpected element 'Foo'.")); + return; + } + QFAIL("No exception thrown"); + + return; +} + + QTEST_MAIN(tst_Settings) #include "tst_settings.moc" diff --git a/tests/auto/installer/settingsoperation/tst_settingsoperation.cpp b/tests/auto/installer/settingsoperation/tst_settingsoperation.cpp index f663297ec..e12bb89c5 100644 --- a/tests/auto/installer/settingsoperation/tst_settingsoperation.cpp +++ b/tests/auto/installer/settingsoperation/tst_settingsoperation.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** @@ -62,7 +55,7 @@ private slots: m_testSettingsFilename = "test.ini"; QSettings testSettings(QDir(m_testSettingsDirPath).filePath(m_testSettingsFilename), QSettings::IniFormat); - m_cleanupFilePathes << QDir(m_testSettingsDirPath).filePath(m_testSettingsFilename); + m_cleanupFilePaths << QDir(m_testSettingsDirPath).filePath(m_testSettingsFilename); testSettings.setValue("testkey", "testvalue"); testSettings.setValue("testcategory/categorytestkey", "categorytestvalue"); testSettings.setValue("testcategory/categoryarrayvalue1", QStringList() << "value1" << @@ -113,7 +106,7 @@ private slots: { const QString verifyFilePath = createFilePath(QTest::currentTestFunction()); const QString testFilePath = createFilePath(QString("_") + QTest::currentTestFunction()); - m_cleanupFilePathes << verifyFilePath << testFilePath; + m_cleanupFilePaths << verifyFilePath << testFilePath; const QString key = "category/key"; const QString value = "value"; @@ -157,7 +150,7 @@ private slots: const QString testFilePath = createFilePath(QTest::currentTestFunction()); QFile testFile(QDir(m_testSettingsDirPath).filePath(m_testSettingsFilename)); QVERIFY2(testFile.copy(testFilePath), testFile.errorString().toLatin1()); - m_cleanupFilePathes << testFilePath; + m_cleanupFilePaths << testFilePath; const QString key = "testkey"; QString testValueString; @@ -287,11 +280,7 @@ private slots: QCOMPARE(verifySettings.value(testKeys.at(0)).isNull(), false); QStringList verifyFirstValue = verifySettings.value(testKeys.at(0)).toStringList(); -#if QT_VERSION < 0x050000 - QCOMPARE(verifyFirstValue.contains(QLatin1String("value3")), QBool(false)); -#else QCOMPARE(verifyFirstValue.contains(QLatin1String("value3")), false); -#endif QCOMPARE(verifySettings.value(testKeys.at(0)), verifySettings.value(testKeys.at(1))); QCOMPARE(verifySettings.value(testKeys.at(1)), verifySettings.value(testKeys.at(2))); } @@ -300,7 +289,7 @@ private slots: // called after all tests void cleanupTestCase() { - foreach (const QString &filePath, m_cleanupFilePathes) + foreach (const QString &filePath, m_cleanupFilePaths) QFile(filePath).remove(); } private: @@ -320,7 +309,7 @@ private: QString m_testSettingsFilename; QString m_testSettingsDirPath; - QStringList m_cleanupFilePathes; + QStringList m_cleanupFilePaths; }; QTEST_MAIN(tst_settingsoperation) diff --git a/tests/auto/installer/solver/solver.pro b/tests/auto/installer/solver/solver.pro index 0094bc090..76e30fa0c 100644 --- a/tests/auto/installer/solver/solver.pro +++ b/tests/auto/installer/solver/solver.pro @@ -1,5 +1,6 @@ include(../../qttest.pri) QT -= gui +QT += qml SOURCES += tst_solver.cpp diff --git a/tests/auto/installer/solver/tst_solver.cpp b/tests/auto/installer/solver/tst_solver.cpp index f0596b31e..83f577bdf 100644 --- a/tests/auto/installer/solver/tst_solver.cpp +++ b/tests/auto/installer/solver/tst_solver.cpp @@ -16,30 +16,27 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** **************************************************************************/ -#include "graph.h" +#include <component.h> +#include <graph.h> +#include <installercalculator.h> +#include <uninstallercalculator.h> +#include <packagemanagercore.h> #include <QTest> @@ -63,6 +60,24 @@ inline uint qHash(const Data &data) return qHash(data.data()); } +class NamedComponent : public Component +{ +public: + NamedComponent(PackageManagerCore *core, const QString &name) + : Component(core) + { + setValue(scName, name); + setValue(scVersion, QLatin1String("1.0.0")); + } + + NamedComponent(PackageManagerCore *core, const QString &name, const QString &version) + : Component(core) + { + setValue(scName, name); + setValue(scVersion, version); + } + +}; class tst_Solver : public QObject { @@ -87,7 +102,7 @@ private slots: QList<QString> resolved = graph.sort(); foreach (const QString &value, resolved) - qDebug(qPrintable(value)); + qDebug("%s", qPrintable(value)); } void sortGraphReverse() @@ -104,7 +119,7 @@ private slots: QList<QString> resolved = graph.sortReverse(); foreach (const QString &value, resolved) - qDebug(qPrintable(value)); + qDebug("%s", qPrintable(value)); } void sortGraphCycle() @@ -120,13 +135,122 @@ private slots: QList<Data> resolved = graph.sort(); foreach (const Data &value, resolved) - qDebug(qPrintable(value.data())); + qDebug("%s", qPrintable(value.data())); QPair<Data, Data> cycle = graph.cycle(); qDebug("Found cycle: %s", graph.hasCycle() ? "true" : "false"); qDebug("(%s) has a indirect dependency on (%s).", qPrintable(cycle.second.data()), qPrintable(cycle.first.data())); } + + void resolveInstaller_data() + { + QTest::addColumn<PackageManagerCore *>("core"); + QTest::addColumn<QList<Component *> >("selectedComponents"); + QTest::addColumn<QList<Component *> >("expectedResult"); + QTest::addColumn<QList<int> >("installReason"); + + PackageManagerCore *core = new PackageManagerCore(); + core->setPackageManager(); + NamedComponent *componentA = new NamedComponent(core, QLatin1String("A")); + NamedComponent *componentAA = new NamedComponent(core, QLatin1String("A.A")); + NamedComponent *componentAB = new NamedComponent(core, QLatin1String("A.B")); + componentA->appendComponent(componentAA); + componentA->appendComponent(componentAB); + NamedComponent *componentB = new NamedComponent(core, QLatin1String("B")); + componentB->addDependency(QLatin1String("A.B")); + core->appendRootComponent(componentA); + core->appendRootComponent(componentB); + + QTest::newRow("Installer resolved") << core + << (QList<Component *>() << componentB) + << (QList<Component *>() << componentAB << componentB) + << (QList<int>() + << InstallerCalculator::Dependent + << InstallerCalculator::Resolved); + } + + void resolveInstaller() + { + QFETCH(PackageManagerCore *, core); + QFETCH(QList<Component *> , selectedComponents); + QFETCH(QList<Component *> , expectedResult); + QFETCH(QList<int>, installReason); + + InstallerCalculator calc(core->components(PackageManagerCore::ComponentType::AllNoReplacements)); + calc.appendComponentsToInstall(selectedComponents); + QList<Component *> result = calc.orderedComponentsToInstall(); + + QCOMPARE(result.count(), expectedResult.count()); + for (int i = 0; i < result.count(); i++) { + QCOMPARE(result.at(i), expectedResult.at(i)); + QCOMPARE((int)calc.installReasonType(result.at(i)), installReason.at(i)); + } + delete core; + } + + void resolveUninstaller_data() + { + QTest::addColumn<PackageManagerCore *>("core"); + QTest::addColumn<QList<Component *> >("selectedToUninstall"); + QTest::addColumn<QList<Component *> >("installedComponents"); + QTest::addColumn<QSet<Component *> >("expectedResult"); + + PackageManagerCore *core = new PackageManagerCore(); + core->setPackageManager(); + NamedComponent *componentA = new NamedComponent(core, QLatin1String("A")); + NamedComponent *componentAA = new NamedComponent(core, QLatin1String("A.A")); + NamedComponent *componentAB = new NamedComponent(core, QLatin1String("A.B")); + componentA->appendComponent(componentAA); + componentA->appendComponent(componentAB); + NamedComponent *componentB = new NamedComponent(core, QLatin1String("B")); + componentB->addDependency(QLatin1String("A.B")); + core->appendRootComponent(componentA); + core->appendRootComponent(componentB); + + componentA->setInstalled(); + componentB->setInstalled(); + componentAB->setInstalled(); + + QTest::newRow("Uninstaller resolved") << core + << (QList<Component *>() << componentAB) + << (QList<Component *>() << componentA << componentB) + << (QSet<Component *>() << componentAB << componentB); + + core = new PackageManagerCore(); + core->setPackageManager(); + NamedComponent *compA = new NamedComponent(core, QLatin1String("A")); + NamedComponent *compB = new NamedComponent(core, QLatin1String("B")); + NamedComponent *compC = new NamedComponent(core, QLatin1String("C")); + compB->addDependency(QLatin1String("A")); + compC->addDependency(QLatin1String("B")); + core->appendRootComponent(compA); + core->appendRootComponent(compB); + core->appendRootComponent(compC); + compA->setInstalled(); + compB->setInstalled(); + + QTest::newRow("Cascade dependencies") << core + << (QList<Component *>() << compA) + << (QList<Component *>() << compB) + << (QSet<Component *>() << compA << compB); + } + + void resolveUninstaller() + { + QFETCH(PackageManagerCore *, core); + QFETCH(QList<Component *> , selectedToUninstall); + QFETCH(QList<Component *> , installedComponents); + QFETCH(QSet<Component *> , expectedResult); + + UninstallerCalculator calc(installedComponents); + calc.appendComponentsToUninstall(selectedToUninstall); + QSet<Component *> result = calc.componentsToUninstall(); + + QCOMPARE(result.count(), expectedResult.count()); + QCOMPARE(result, expectedResult); + delete core; + } }; QTEST_MAIN(tst_Solver) diff --git a/tests/auto/installer/task/task.pro b/tests/auto/installer/task/task.pro index ff41f5cce..9ea8f30ed 100644 --- a/tests/auto/installer/task/task.pro +++ b/tests/auto/installer/task/task.pro @@ -1,8 +1,6 @@ include(../../qttest.pri) QT -= gui -QT += network -isEqual(QT_MAJOR_VERSION, 5) { - QT += concurrent -} +QT += network concurrent + SOURCES += tst_task.cpp diff --git a/tests/auto/installer/task/tst_task.cpp b/tests/auto/installer/task/tst_task.cpp index a966671ac..327b077a1 100644 --- a/tests/auto/installer/task/tst_task.cpp +++ b/tests/auto/installer/task/tst_task.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** @@ -41,7 +34,7 @@ #include <copyfiletask.h> #include <downloadfiletask.h> -#include <fileutils.h> +#include <fileio.h> #include <QFutureWatcher> #include <QSignalSpy> diff --git a/tests/downloadspeed/main.cpp b/tests/downloadspeed/main.cpp index 4edc0d8b6..ff741c421 100644 --- a/tests/downloadspeed/main.cpp +++ b/tests/downloadspeed/main.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** diff --git a/tests/environmentvariable/environmentvariabletest.cpp b/tests/environmentvariable/environmentvariabletest.cpp index 472992214..395e436a7 100644 --- a/tests/environmentvariable/environmentvariabletest.cpp +++ b/tests/environmentvariable/environmentvariabletest.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** @@ -60,11 +53,7 @@ EnvironmentVariableTest::EnvironmentVariableTest() void EnvironmentVariableTest::testPersistentNonSystem() { #ifndef Q_OS_WIN - #if QT_VERSION < 0x050000 - QSKIP("This operation only works on Windows", SkipSingle); - #else - QSKIP("This operation only works on Windows"); - #endif + QSKIP("This operation only works on Windows"); #endif KDUpdater::Application app; QString key = QLatin1String("IFW_TestKey"); @@ -93,11 +82,7 @@ void EnvironmentVariableTest::testPersistentNonSystem() void EnvironmentVariableTest::testNonPersistentNonSystem() { #ifndef Q_OS_WIN - #if QT_VERSION < 0x050000 - QSKIP("This operation only works on Windows", SkipSingle); - #else - QSKIP("This operation only works on Windows"); - #endif + QSKIP("This operation only works on Windows"); #endif KDUpdater::Application app; QString key = QLatin1String("IFW_TestKey"); diff --git a/tests/environmentvariable/environmentvariabletest.h b/tests/environmentvariable/environmentvariabletest.h index 8ffbc177b..e032fac68 100644 --- a/tests/environmentvariable/environmentvariabletest.h +++ b/tests/environmentvariable/environmentvariabletest.h @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** diff --git a/tests/fileengineclient/fileengineclient.cpp b/tests/fileengineclient/fileengineclient.cpp deleted file mode 100644 index f2c09bb14..000000000 --- a/tests/fileengineclient/fileengineclient.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Installer Framework. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** 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. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -**************************************************************************/ - -#include <fsengineclient.h> - -#include <QProcess> -#include <QCoreApplication> -#include <QThread> -#include <QDebug> - -class OutputHandler : public QObject -{ - Q_OBJECT - -public: - OutputHandler(QProcess* processWrapper, QObject *parent = 0) - : QObject (parent) - { - m_process = processWrapper; - QObject::connect(m_process, SIGNAL(readyRead()), - this, SLOT(readProcessOutput()), Qt::DirectConnection); - } - void clearSavedOutPut() { m_savedOutPut.clear(); } - QByteArray savedOutPut() { return m_savedOutPut; } - -public slots: - void readProcessOutput() - { - Q_ASSERT(m_process); - Q_ASSERT(QThread::currentThread() == m_process->thread()); - if (QThread::currentThread() != m_process->thread()) { - qDebug() << Q_FUNC_INFO << QLatin1String("can only be called from the same thread as the " - "process is."); - } - const QByteArray output = m_process->readAll(); - if (!output.isEmpty()) { - m_savedOutPut.append(output); - qDebug() << output; - } - } - -private: - QProcess* m_process; - QByteArray m_savedOutPut; -}; - - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - - QString fileName(QLatin1String("give_me_some_output.bat")); - QFile file(fileName); - if (file.exists() && !file.remove()) { - qFatal(qPrintable(QString::fromLatin1("something is wrong, can not delete: %1").arg(file.fileName()))); - return -1; - } - if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) - { - qFatal(qPrintable(QString::fromLatin1("something is wrong, can not open for writing to: %1") - .arg(file.fileName()))); - return -2; - } - - QTextStream out(&file); - out << QLatin1String("echo mega test output"); - if (!file.flush()) - { - qFatal(qPrintable(QString::fromLatin1("something is wrong, can not write to: %1").arg(file.fileName()))); - return -3; - } - file.close(); - - -//first run as a normal QProcess - QByteArray firstOutPut; - { - QProcess process; - OutputHandler outputer(&process); - - process.start(fileName); - qDebug() << "1"; - { - const QByteArray output = process.readAll(); - if (!output.isEmpty()) { - qDebug() << output; - } - } - process.waitForStarted(); - qDebug() << "2"; - { - const QByteArray output = process.readAll(); - if (!output.isEmpty()) { - qDebug() << output; - } - } - process.waitForFinished(); - qDebug() << "3"; - { - const QByteArray output = process.readAll(); - if (!output.isEmpty()) { - qDebug() << output; - } - } - firstOutPut = outputer.savedOutPut(); - } -//first run as a normal QProcess - QByteArray secondOutPut; - { - FSEngineClientHandler::instance().enableTestMode(); - FSEngineClientHandler::instance().init(39999); - FSEngineClientHandler::instance().setActive(true); - - QProcess process; - OutputHandler outputer(&process); - - process.start(fileName); - qDebug() << "1"; - { - const QByteArray output = process.readAll(); - if (!output.isEmpty()) { - qDebug() << output; - } - } - process.waitForStarted(); - qDebug() << "2"; - { - const QByteArray output = process.readAll(); - if (!output.isEmpty()) { - qDebug() << output; - } - } - process.waitForFinished(); - qDebug() << "3"; - { - const QByteArray output = process.readAll(); - if (!output.isEmpty()) { - qDebug() << output; - } - } - secondOutPut = outputer.savedOutPut(); - } - - if (firstOutPut != secondOutPut) { - qFatal(qPrintable(QString::fromLatin1("Test failed: output is different between a normal QProcess " - "and QProcessWrapper: %1").arg(file.fileName()))); - return -2; - } else { - qDebug() << QLatin1String("Test OK: QProcess works as expected."); - } - - return app.exec(); -} - -#include "fileengineclient.moc" diff --git a/tests/fileengineclient/fileengineclient.pro b/tests/fileengineclient/fileengineclient.pro deleted file mode 100644 index 8b0538a55..000000000 --- a/tests/fileengineclient/fileengineclient.pro +++ /dev/null @@ -1,15 +0,0 @@ -TEMPLATE = app -INCLUDEPATH += . .. -TARGET = fileengineclient - -include(../../installerfw.pri) - -QT -= gui -QT += network - -CONFIG += console -DESTDIR = $$IFW_APP_PATH - -SOURCES += fileengineclient.cpp - -macx:include(../../no_app_bundle.pri) diff --git a/tests/fileengineserver/fileengineserver.cpp b/tests/fileengineserver/fileengineserver.cpp deleted file mode 100644 index 77d49feb8..000000000 --- a/tests/fileengineserver/fileengineserver.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Installer Framework. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** 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. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -**************************************************************************/ - -#include <fsengineserver.h> - -#include <QCoreApplication> - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - FSEngineServer server(39999); - server.enableTestMode(); - return app.exec(); -} diff --git a/tests/fileengineserver/fileengineserver.pro b/tests/fileengineserver/fileengineserver.pro deleted file mode 100644 index e4c125992..000000000 --- a/tests/fileengineserver/fileengineserver.pro +++ /dev/null @@ -1,14 +0,0 @@ -TEMPLATE = app -INCLUDEPATH += . .. -TARGET = fileengineserver - -include(../../installerfw.pri) - -QT -= gui - -CONFIG += console -DESTDIR = $$IFW_APP_PATH - -SOURCES += fileengineserver.cpp - -macx:include(../../no_app_bundle.pri) diff --git a/tests/test-framework/checker/run.py b/tests/test-framework/checker/run.py index db6ce398e..3f13548d9 100644 --- a/tests/test-framework/checker/run.py +++ b/tests/test-framework/checker/run.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/checker/scripts/generate-filelist.py b/tests/test-framework/checker/scripts/generate-filelist.py index ec9b2c54c..1cf685b0f 100644 --- a/tests/test-framework/checker/scripts/generate-filelist.py +++ b/tests/test-framework/checker/scripts/generate-filelist.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/checker/testrunner/files.py b/tests/test-framework/checker/testrunner/files.py index 5ba887c7f..0af6a5456 100644 --- a/tests/test-framework/checker/testrunner/files.py +++ b/tests/test-framework/checker/testrunner/files.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/checker/testrunner/registry.py b/tests/test-framework/checker/testrunner/registry.py index ccbab655c..f11c7ff14 100644 --- a/tests/test-framework/checker/testrunner/registry.py +++ b/tests/test-framework/checker/testrunner/registry.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/checker/testrunner/testexception.py b/tests/test-framework/checker/testrunner/testexception.py index 06e8d2f92..001ebd5d2 100644 --- a/tests/test-framework/checker/testrunner/testexception.py +++ b/tests/test-framework/checker/testrunner/testexception.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/checker/testrunner/testrunner.py b/tests/test-framework/checker/testrunner/testrunner.py index fa20dd153..d7608bd92 100644 --- a/tests/test-framework/checker/testrunner/testrunner.py +++ b/tests/test-framework/checker/testrunner/testrunner.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/site/listVMs.sh b/tests/test-framework/site/listVMs.sh index 81dd2a813..c2fd1e2c3 100644 --- a/tests/test-framework/site/listVMs.sh +++ b/tests/test-framework/site/listVMs.sh @@ -16,24 +16,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/tests/simpletest.py b/tests/test-framework/tests/simpletest.py index 2f838250a..477585c89 100644 --- a/tests/test-framework/tests/simpletest.py +++ b/tests/test-framework/tests/simpletest.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/cdashreporter.py b/tests/test-framework/vmware/cdashreporter.py index f4c605109..895418b32 100644 --- a/tests/test-framework/vmware/cdashreporter.py +++ b/tests/test-framework/vmware/cdashreporter.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/control.py b/tests/test-framework/vmware/control.py index b2ae0cb39..575b949b6 100644 --- a/tests/test-framework/vmware/control.py +++ b/tests/test-framework/vmware/control.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/ftpsource.py b/tests/test-framework/vmware/ftpsource.py index 3ad3b5c6e..6ec47c8ec 100644 --- a/tests/test-framework/vmware/ftpsource.py +++ b/tests/test-framework/vmware/ftpsource.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/guest.py b/tests/test-framework/vmware/guest.py index a59e52cde..88913ccce 100644 --- a/tests/test-framework/vmware/guest.py +++ b/tests/test-framework/vmware/guest.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/guestconfig.py b/tests/test-framework/vmware/guestconfig.py index 8d7ed8c7d..92a900a21 100644 --- a/tests/test-framework/vmware/guestconfig.py +++ b/tests/test-framework/vmware/guestconfig.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/reporter.py b/tests/test-framework/vmware/reporter.py index bf68a7381..6accd1e3f 100644 --- a/tests/test-framework/vmware/reporter.py +++ b/tests/test-framework/vmware/reporter.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/result.py b/tests/test-framework/vmware/result.py index 6e97b10b3..4689014d4 100644 --- a/tests/test-framework/vmware/result.py +++ b/tests/test-framework/vmware/result.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/run-test.py b/tests/test-framework/vmware/run-test.py index fff5cd76b..6b302f706 100644 --- a/tests/test-framework/vmware/run-test.py +++ b/tests/test-framework/vmware/run-test.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/run.py b/tests/test-framework/vmware/run.py index 12140ba19..98cbddacb 100644 --- a/tests/test-framework/vmware/run.py +++ b/tests/test-framework/vmware/run.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/source.py b/tests/test-framework/vmware/source.py index 8d3004bca..bba836052 100644 --- a/tests/test-framework/vmware/source.py +++ b/tests/test-framework/vmware/source.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/testcase.py b/tests/test-framework/vmware/testcase.py index f03e7149e..6a0c0b462 100644 --- a/tests/test-framework/vmware/testcase.py +++ b/tests/test-framework/vmware/testcase.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/utils.py b/tests/test-framework/vmware/utils.py index c5d8504d4..d7c6b75bc 100644 --- a/tests/test-framework/vmware/utils.py +++ b/tests/test-framework/vmware/utils.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/virtualmachine.py b/tests/test-framework/vmware/virtualmachine.py index 8b42c3ca8..77b32ceef 100644 --- a/tests/test-framework/vmware/virtualmachine.py +++ b/tests/test-framework/vmware/virtualmachine.py @@ -18,24 +18,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-framework/vmware/xmlutils.py b/tests/test-framework/vmware/xmlutils.py index ba56161f5..0ead434d8 100644 --- a/tests/test-framework/vmware/xmlutils.py +++ b/tests/test-framework/vmware/xmlutils.py @@ -17,24 +17,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/test-installer/BatchSubstitute.bat b/tests/test-installer/BatchSubstitute.bat index 42333eb26..9b7dc1515 100644 --- a/tests/test-installer/BatchSubstitute.bat +++ b/tests/test-installer/BatchSubstitute.bat @@ -1,6 +1,6 @@ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: -:: Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +:: Copyright (C) 2012-2014 Digia Plc and/or its subsidiary(-ies). :: Contact: http://www.qt-project.org/legal :: :: This file is part of the Qt Installer Framework. @@ -16,24 +16,17 @@ :: :: 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. +:: General Public License version 2.1 or version 3 as published by the Free +:: Software Foundation and appearing in the file LICENSE.LGPLv21 and +:: LICENSE.LGPLv3 included in the packaging of this file. Please review the +:: following information to ensure the GNU Lesser General Public License +:: requirements will be met: https://www.gnu.org/licenses/lgpl.html and +:: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. :: :: In addition, as a special exception, Digia gives you certain additional -:: rights. These rights are described in the Digia Qt LGPL Exception +:: rights. These rights are described in the Digia Qt LGPL Exception :: version 1.1, included in the file LGPL_EXCEPTION.txt in this package. :: -:: GNU General Public License Usage -:: Alternatively, this file may be used under the terms of the GNU -:: General Public License version 3.0 as published by the Free Software -:: Foundation and appearing in the file LICENSE.GPL included in the -:: packaging of this file. Please review the following information to -:: ensure the GNU General Public License version 3.0 requirements will be -:: met: http://www.gnu.org/copyleft/gpl.html. -:: :: :: $QT_END_LICENSE$ :: diff --git a/tests/test-installer/create-test-installer.bat b/tests/test-installer/create-test-installer.bat index eb9ac9dc8..5aa1b0c1b 100644 --- a/tests/test-installer/create-test-installer.bat +++ b/tests/test-installer/create-test-installer.bat @@ -1,6 +1,6 @@ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: -:: Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +:: Copyright (C) 2012-2014 Digia Plc and/or its subsidiary(-ies). :: Contact: http://www.qt-project.org/legal :: :: This file is part of the Qt Installer Framework. @@ -16,24 +16,17 @@ :: :: 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. +:: General Public License version 2.1 or version 3 as published by the Free +:: Software Foundation and appearing in the file LICENSE.LGPLv21 and +:: LICENSE.LGPLv3 included in the packaging of this file. Please review the +:: following information to ensure the GNU Lesser General Public License +:: requirements will be met: https://www.gnu.org/licenses/lgpl.html and +:: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. :: :: In addition, as a special exception, Digia gives you certain additional -:: rights. These rights are described in the Digia Qt LGPL Exception +:: rights. These rights are described in the Digia Qt LGPL Exception :: version 1.1, included in the file LGPL_EXCEPTION.txt in this package. :: -:: GNU General Public License Usage -:: Alternatively, this file may be used under the terms of the GNU -:: General Public License version 3.0 as published by the Free Software -:: Foundation and appearing in the file LICENSE.GPL included in the -:: packaging of this file. Please review the following information to -:: ensure the GNU General Public License version 3.0 requirements will be -:: met: http://www.gnu.org/copyleft/gpl.html. -:: :: :: $QT_END_LICENSE$ :: diff --git a/tests/test-installer/create-test-installer.sh b/tests/test-installer/create-test-installer.sh index e3c3613d5..e8b93d19a 100755 --- a/tests/test-installer/create-test-installer.sh +++ b/tests/test-installer/create-test-installer.sh @@ -16,24 +16,17 @@ ## ## 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. +## General Public License version 2.1 or version 3 as published by the Free +## Software Foundation and appearing in the file LICENSE.LGPLv21 and +## LICENSE.LGPLv3 included in the packaging of this file. Please review the +## following information to ensure the GNU Lesser General Public License +## requirements will be met: https://www.gnu.org/licenses/lgpl.html and +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ## ## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception +## rights. These rights are described in the Digia Qt LGPL Exception ## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## ## ## $QT_END_LICENSE$ ## diff --git a/tests/testreturn/main.cpp b/tests/testreturn/main.cpp index c4d34e9be..e5aee9518 100644 --- a/tests/testreturn/main.cpp +++ b/tests/testreturn/main.cpp @@ -16,24 +16,17 @@ ** ** 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. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** ** $QT_END_LICENSE$ ** diff --git a/tests/tests.pro b/tests/tests.pro index 714a707ee..1e8963ed2 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -1,32 +1,7 @@ CONFIG += ordered TEMPLATE = subdirs -EXTRASUBDIRS = \ +SUBDIRS = \ auto \ downloadspeed \ - environmentvariable \ - fileengineclient \ - fileengineserver - - -include(../installerfw.pri) - -!isEqual(IFW_SOURCE_TREE, $$IFW_BUILD_TREE) { - for(SUBDIR, EXTRASUBDIRS) { - mkdir.commands += $$QMAKE_MKDIR $$SUBDIR $${IFW_NEWLINE} - } - QMAKE_EXTRA_TARGETS += mkdir -} - -for(SUBDIR, EXTRASUBDIRS) { - tests.commands += cd $$SUBDIR && $(QMAKE) -r $$PWD/$$SUBDIR && $(MAKE) $${IFW_NEWLINE} -} -!isEqual(IFW_SOURCE_TREE, $$IFW_BUILD_TREE) { - tests.depends = mkdir -} -QMAKE_EXTRA_TARGETS *= tests - -# forward make "check" target to autotests -check.commands += cd $$PWD/auto && $(QMAKE) -r $$PWD/auto && $(MAKE) check -check.depends = first -QMAKE_EXTRA_TARGETS *= check + environmentvariable |