aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/examples
diff options
context:
space:
mode:
authorDamian Jansen <damian.jansen@nokia.com>2011-08-30 16:18:20 +1000
committerQt by Nokia <qt-info@nokia.com>2011-09-05 03:09:09 +0200
commit76dd4f8af9c48a685cb50bfa02389b392bc12a5a (patch)
tree959044545ec8b8b5d6ef40489c02d4885d4ec619 /tests/auto/declarative/examples
parentf22ae0f5f18a354bf3addd8023ad8b8810e42bac (diff)
Update extension tutorials and examples to QtQuick2
Also add missing licence header and update example tests Change-Id: Ic2dc8c893ddf22f646eaeba86b6f3b4a2772726c Reviewed-on: http://codereview.qt.nokia.com/3844 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
Diffstat (limited to 'tests/auto/declarative/examples')
-rw-r--r--tests/auto/declarative/examples/examples.pro19
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp46
2 files changed, 11 insertions, 54 deletions
diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro
index a19700cb8e..0875e1fc54 100644
--- a/tests/auto/declarative/examples/examples.pro
+++ b/tests/auto/declarative/examples/examples.pro
@@ -1,23 +1,12 @@
load(qttest_p4)
-contains(QT_CONFIG,declarative): QT += declarative qtquick1
+contains(QT_CONFIG,declarative): QT += declarative
macx:CONFIG -= app_bundle
-SOURCES += tst_examples.cpp
-
-include(../../../../tools/qmlviewer/qml.pri)
-
-include(../symbianlibs.pri)
-
-symbian: {
- importFiles.files = data
- importFiles.path = .
- DEPLOYMENT += importFiles
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
+SOURCES += tst_examples.cpp
+DEFINES += SRCDIR=\\\"$$PWD\\\"
CONFIG += parallel_test
-QT += core-private gui-private v8-private declarative-private qtquick1-private
+QT += core-private gui-private v8-private declarative-private
qpa:CONFIG+=insignificant_test # QTBUG-20990, aborts
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
index 072ab7524e..4a3a0857c2 100644
--- a/tests/auto/declarative/examples/tst_examples.cpp
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -38,21 +38,15 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include <qtest.h>
#include <QLibraryInfo>
#include <QDir>
#include <QProcess>
#include <QDebug>
-#include "qmlruntime.h"
-#include <QDeclarativeView>
#include <QSGView>
#include <QDeclarativeError>
-#ifdef Q_OS_SYMBIAN
-// In Symbian OS test data is located in applications private dir
-#define SRCDIR "."
-#endif
-
class tst_examples : public QObject
{
Q_OBJECT
@@ -60,8 +54,6 @@ public:
tst_examples();
private slots:
- void examples_data();
- void examples();
void sgexamples_data();
void sgexamples();
@@ -185,7 +177,12 @@ that they start and exit cleanly.
Examples are any .qml files under the examples/ directory that start
with a lower case letter.
*/
-void tst_examples::examples_data()
+static void silentErrorsMsgHandler(QtMsgType, const char *)
+{
+}
+
+
+void tst_examples::sgexamples_data()
{
QTest::addColumn<QString>("file");
@@ -200,37 +197,8 @@ void tst_examples::examples_data()
QTest::newRow(qPrintable(file)) << file;
}
-static void silentErrorsMsgHandler(QtMsgType, const char *)
-{
-}
-
-void tst_examples::examples()
-{
- QFETCH(QString, file);
-
- QDeclarativeViewer viewer;
-
- QtMsgHandler old = qInstallMsgHandler(silentErrorsMsgHandler);
- QVERIFY(viewer.open(file));
- qInstallMsgHandler(old);
-
- if (viewer.view()->status() == QDeclarativeView::Error)
- qWarning() << viewer.view()->errors();
-
- QCOMPARE(viewer.view()->status(), QDeclarativeView::Ready);
- viewer.show();
-
- QTest::qWaitForWindowShown(&viewer);
-}
-
-void tst_examples::sgexamples_data()
-{
- examples_data();
-}
-
void tst_examples::sgexamples()
{
- qputenv("QMLSCENE_IMPORT_NAME", "quick1");
QFETCH(QString, file);
QSGView view;