diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-09-29 02:14:44 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-10-01 05:29:23 (GMT) |
commit | c2c367ebeb039c42cb4fec50b2b6495624837978 (patch) | |
tree | d4b496f03ff675fa50ca5a8e1cacb44a002f7f72 | |
parent | dcc5c7ea047513ceb6fc75aac526b17ad6629d4c (diff) | |
download | Qt-c2c367ebeb039c42cb4fec50b2b6495624837978.zip Qt-c2c367ebeb039c42cb4fec50b2b6495624837978.tar.gz Qt-c2c367ebeb039c42cb4fec50b2b6495624837978.tar.bz2 |
Add test for Qt 4.7 module
Task-number: QTBUG-13799
Reviewed-by: Martin Jones
(cherry picked from commit 6f35701275ab0cd80daec45b3407725b10571693)
5 files changed, 183 insertions, 1 deletions
diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index a7fb3b8..f0fcfa9 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -69,7 +69,8 @@ SUBDIRS += \ qdeclarativexmlhttprequest \ qdeclarativexmllistmodel \ qmlvisual \ - qpacketprotocol + qpacketprotocol \ + moduleqt47 contains(QT_CONFIG, webkit) { SUBDIRS += \ diff --git a/tests/auto/declarative/moduleqt47/data/importqt47.qml b/tests/auto/declarative/moduleqt47/data/importqt47.qml new file mode 100644 index 0000000..0a1b533 --- /dev/null +++ b/tests/auto/declarative/moduleqt47/data/importqt47.qml @@ -0,0 +1,80 @@ +import Qt 4.7 + +Item { + QtObject {} + + Component { Item {} } + + // Util + states: [ + State { + name: "bob" + AnchorChanges {} + ParentChange {} + StateChangeScript {} + PropertyChanges {} + } + ] + transitions: [ + Transition { + AnchorAnimation {} + ColorAnimation {} + SmoothedAnimation {} + NumberAnimation {} + ParallelAnimation {} + ParentAnimation {} + PauseAnimation {} + PropertyAnimation {} + RotationAnimation {} + ScriptAction {} + SequentialAnimation {} + SpringAnimation {} + Vector3dAnimation {} + } + ] + + Behavior on x {} + Binding {} + Connections {} + FontLoader {} + ListModel { ListElement {} } + SystemPalette {} + Timer {} + + // graphic items + BorderImage {} + Column {} + MouseArea {} + Flickable {} + Flipable {} + Flow {} + FocusPanel {} + FocusScope {} + Rectangle { gradient: Gradient { GradientStop {} } } + Grid {} + GridView {} + Image {} + ListView {} + Loader {} + PathView { + path: Path { + PathLine {} + PathCubic {} + PathPercent {} + PathQuad {} + PathAttribute {} + } + } + Repeater {} + Rotation {} + Row {} + Translate {} + Scale {} + Text {} + TextEdit {} + TextInput {} + VisualItemModel {} + VisualDataModel {} + + Keys.onPressed: console.log("Press") +} diff --git a/tests/auto/declarative/moduleqt47/moduleqt47.pro b/tests/auto/declarative/moduleqt47/moduleqt47.pro new file mode 100644 index 0000000..4ee634e --- /dev/null +++ b/tests/auto/declarative/moduleqt47/moduleqt47.pro @@ -0,0 +1,16 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_moduleqt47.cpp + +symbian: { + importFiles.sources = data + importFiles.path = . + DEPLOYMENT = importFiles +} else { + DEFINES += SRCDIR=\\\"$$PWD\\\" +} + +CONFIG += parallel_test + diff --git a/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp b/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp new file mode 100644 index 0000000..c1896a7 --- /dev/null +++ b/tests/auto/declarative/moduleqt47/tst_moduleqt47.cpp @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <qtest.h> +#include <QtDeclarative/qdeclarativeengine.h> +#include <QtDeclarative/qdeclarativecomponent.h> + +#ifdef Q_OS_SYMBIAN +// In Symbian OS test data is located in applications private dir +#define SRCDIR "." +#endif + +class tst_moduleqt47 : public QObject +{ + Q_OBJECT +public: + tst_moduleqt47(); + +private slots: + void create(); + +private: + QDeclarativeEngine engine; +}; + +tst_moduleqt47::tst_moduleqt47() +{ +} + +void tst_moduleqt47::create() +{ + QDeclarativeEngine engine; + QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/importqt47.qml")); + QObject *obj = qobject_cast<QObject*>(c.create()); + + QVERIFY(obj != 0); + delete obj; +} + +QTEST_MAIN(tst_moduleqt47) + +#include "tst_moduleqt47.moc" diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index f811555..c6b2302 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -1715,6 +1715,9 @@ void tst_qdeclarativelanguage::initTestCase() { registerTypes(); + // Registering the TestType class in other modules should have no adverse effects + qmlRegisterType<TestType>("com.nokia.TestPre", 1, 0, "Test"); + qmlRegisterType<TestType>("com.nokia.Test", 0, 0, "TestTP"); qmlRegisterType<TestType>("com.nokia.Test", 1, 0, "Test"); qmlRegisterType<TestType>("com.nokia.Test", 1, 5, "Test"); @@ -1722,6 +1725,9 @@ void tst_qdeclarativelanguage::initTestCase() qmlRegisterType<TestType>("com.nokia.Test", 1, 9, "OldTest"); qmlRegisterType<TestType2>("com.nokia.Test", 1, 12, "Test"); + // Registering the TestType class in other modules should have no adverse effects + qmlRegisterType<TestType>("com.nokia.TestPost", 1, 0, "Test"); + // Create locale-specific file // For POSIX, this will just be data/I18nType.qml, since POSIX is 7-bit // For iso8859-1 locale, this will just be data/I18nType?????.qml where ????? is 5 8-bit characters |