aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/examples/tst_examples.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/examples/tst_examples.cpp')
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp49
1 files changed, 10 insertions, 39 deletions
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;