diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-09-12 08:12:58 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-09-12 08:12:58 +0200 |
commit | d77218522eb480c8d528de18049cd7b604cdeb2a (patch) | |
tree | a6433a8e9205a95006eae10b53285a0e3487423d /tests/auto/declarative/examples | |
parent | 589c8445e2623ef8e0b8294d7c558a2948b2a5e3 (diff) | |
parent | d5686fa2ac2248d5a31237573fa08697f18f035f (diff) |
Merge branch 'master' into refactor
Conflicts:
examples/declarative/cppextensions/qwidgets/qwidgets.pro
examples/declarative/minehunt/main.cpp
examples/declarative/minehunt/minehunt.pro
src/declarative/items/context2d/qsgcontext2d.cpp
src/declarative/items/qsgflickable.cpp
src/declarative/items/qsgtextedit.cpp
src/declarative/items/qsgtextinput.cpp
src/declarative/particles/qsgangleddirection.cpp
src/declarative/particles/qsgcumulativedirection.cpp
src/declarative/particles/qsgcumulativedirection_p.h
src/declarative/particles/qsgfollowemitter.cpp
src/declarative/particles/qsgmodelparticle.cpp
src/declarative/particles/qsgparticlesystem.cpp
src/qtquick1/util/qdeclarativeview.h
tests/auto/declarative/examples/examples.pro
tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp
Change-Id: Ib4be2a5e742dee1a399d73da97161736f77448e5
Diffstat (limited to 'tests/auto/declarative/examples')
-rw-r--r-- | tests/auto/declarative/examples/examples.pro | 17 | ||||
-rw-r--r-- | tests/auto/declarative/examples/tst_examples.cpp | 49 |
2 files changed, 13 insertions, 53 deletions
diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro index 75adbb53ba..b1e120094d 100644 --- a/tests/auto/declarative/examples/examples.pro +++ b/tests/auto/declarative/examples/examples.pro @@ -1,20 +1,9 @@ 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 diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp index e2edc3e93c..563aa3ce84 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(); @@ -77,6 +69,9 @@ tst_examples::tst_examples() { // Add directories you want excluded here + // Not run in QSGView + excludedDirs << "examples/declarative/qtquick1"; + // These snippets are not expected to run on their own. excludedDirs << "doc/src/snippets/declarative/visualdatamodel_rootindex"; excludedDirs << "doc/src/snippets/declarative/qtbinding"; @@ -185,7 +180,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 +200,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; |