aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/examples/tst_examples.cpp
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 14:13:26 +0200
committeraxis <qt-info@nokia.com>2011-04-27 14:40:44 +0200
commita129444bb0156c936900dbd2f12bd9f427ff366c (patch)
treee2e8e77f185d5a5ac32ea0a96cd9945c742e8663 /tests/auto/declarative/examples/tst_examples.cpp
parent885735d011472bcfbb96e688d9e64553d7fe9d4b (diff)
Initial import from qtquick2.
Branched from the monolithic repo, Qt qtquick2 branch, at commit a4a585d2ee907746682846ae6e8a48e19deef469
Diffstat (limited to 'tests/auto/declarative/examples/tst_examples.cpp')
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp42
1 files changed, 30 insertions, 12 deletions
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
index 1a5ff107a4..72d1ff639a 100644
--- a/tests/auto/declarative/examples/tst_examples.cpp
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -45,6 +45,7 @@
#include <QDebug>
#include "qmlruntime.h"
#include <QDeclarativeView>
+#include <QSGView>
#include <QDeclarativeError>
#ifdef Q_OS_SYMBIAN
@@ -61,10 +62,11 @@ public:
private slots:
void examples_data();
void examples();
+ void sgexamples_data();
+ void sgexamples();
void namingConvention();
private:
- QString qmlruntime;
QStringList excludedDirs;
void namingConvention(const QDir &);
@@ -73,24 +75,15 @@ private:
tst_examples::tst_examples()
{
- QString binaries = QLibraryInfo::location(QLibraryInfo::BinariesPath);
-
-#if defined(Q_WS_MAC)
- qmlruntime = QDir(binaries).absoluteFilePath("qml.app/Contents/MacOS/qml");
-#elif defined(Q_WS_WIN)
- qmlruntime = QDir(binaries).absoluteFilePath("qml.exe");
-#else
- qmlruntime = QDir(binaries).absoluteFilePath("qml");
-#endif
-
-
// Add directories you want excluded here
excludedDirs << "doc/src/snippets/declarative/visualdatamodel_rootindex";
excludedDirs << "doc/src/snippets/declarative/qtbinding";
+ excludedDirs << "doc/src/snippets/declarative/imports";
#ifdef QT_NO_WEBKIT
excludedDirs << "examples/declarative/modelviews/webview";
excludedDirs << "demos/declarative/webbrowser";
+ excludedDirs << "doc/src/snippets/declarative/webview";
#endif
#ifdef QT_NO_XMLPATTERNS
@@ -225,6 +218,31 @@ void tst_examples::examples()
QTest::qWaitForWindowShown(&viewer);
}
+void tst_examples::sgexamples_data()
+{
+ examples_data();
+}
+
+void tst_examples::sgexamples()
+{
+ qputenv("QMLSCENE_IMPORT_NAME", "quick1");
+ QFETCH(QString, file);
+
+ QSGView view;
+
+ QtMsgHandler old = qInstallMsgHandler(silentErrorsMsgHandler);
+ view.setSource(file);
+ qInstallMsgHandler(old);
+
+ if (view.status() == QSGView::Error)
+ qWarning() << view.errors();
+
+ QCOMPARE(view.status(), QSGView::Ready);
+ view.show();
+
+ QTest::qWaitForWindowShown(&view);
+}
+
QTEST_MAIN(tst_examples)
#include "tst_examples.moc"