aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2011-05-16 13:49:56 +1000
committerCharles Yin <charles.yin@nokia.com>2011-05-17 14:55:32 +1000
commit7740c4c9a1a3cba3fec26e8995bfc8af9f94cd06 (patch)
tree0f117df6edacfba191ddc86ecb46e96c85e389d0
parentab858bc8e650f1120495f968379f37257c774b5f (diff)
skip unit tests if no required OpenGL 2.0 feature on this platform
-rw-r--r--tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp16
-rw-r--r--tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp15
-rw-r--r--tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp14
-rw-r--r--tests/auto/declarative/qsggridview/tst_qsggridview.cpp13
-rw-r--r--tests/auto/declarative/qsglistview/tst_qsglistview.cpp14
-rw-r--r--tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp15
-rw-r--r--tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp15
-rw-r--r--tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp13
-rw-r--r--tests/auto/declarative/qsgtext/tst_qsgtext.cpp13
-rw-r--r--tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp13
-rw-r--r--tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp14
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp13
12 files changed, 167 insertions, 1 deletions
diff --git a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp
index 2cc6b3eac2..1892350058 100644
--- a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp
+++ b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp
@@ -47,6 +47,7 @@
#include <private/qdeclarativevaluetype_p.h>
#include <math.h>
#include "../../../shared/util.h"
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -60,6 +61,9 @@ public:
tst_qsgflickable();
private slots:
+ void initTestCase();
+ void cleanupTestCase();
+
void create();
void horizontalViewportSize();
void verticalViewportSize();
@@ -86,6 +90,18 @@ tst_qsgflickable::tst_qsgflickable()
{
}
+void tst_qsgflickable::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("Flickable item needs OpenGL 2.0", SkipAll);
+}
+
+void tst_qsgflickable::cleanupTestCase()
+{
+
+}
+
void tst_qsgflickable::create()
{
QDeclarativeEngine engine;
diff --git a/tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp b/tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp
index 205c2ce607..a5e8105405 100644
--- a/tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp
+++ b/tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp
@@ -47,6 +47,8 @@
#include <QFontMetrics>
#include <private/qsgrectangle_p.h>
#include <math.h>
+#include <QtOpenGL/QGLShaderProgram>
+
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -60,6 +62,8 @@ public:
tst_qsgflipable();
private slots:
+ void initTestCase();
+ void cleanupTestCase();
void create();
void checkFrontAndBack();
void setFrontAndBack();
@@ -75,6 +79,17 @@ private:
tst_qsgflipable::tst_qsgflipable()
{
}
+void tst_qsgflipable::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("Flipable item needs OpenGL 2.0", SkipAll);
+}
+
+void tst_qsgflipable::cleanupTestCase()
+{
+
+}
void tst_qsgflipable::create()
{
diff --git a/tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp b/tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp
index c793ce91c5..98ed425b1d 100644
--- a/tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp
+++ b/tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp
@@ -47,6 +47,7 @@
#include <private/qsgtextedit_p.h>
#include <private/qsgtext_p.h>
#include <QtDeclarative/private/qsgfocusscope_p.h>
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -63,6 +64,8 @@ public:
T *findItem(QSGItem *parent, const QString &id);
private slots:
+ void initTestCase();
+ void cleanupTestCase();
void basic();
void nested();
void noFocus();
@@ -73,6 +76,17 @@ private slots:
void qtBug13380();
void forceActiveFocus();
};
+void tst_qsgfocusscope::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("FocusScope item needs OpenGL 2.0", SkipAll);
+}
+
+void tst_qsgfocusscope::cleanupTestCase()
+{
+
+}
/*
Find an item with the specified id.
diff --git a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp
index 931ae7ee49..73744794e3 100644
--- a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp
+++ b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp
@@ -52,6 +52,7 @@
#include <QtDeclarative/private/qsgtext_p.h>
#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
#include "../../../shared/util.h"
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -65,6 +66,8 @@ public:
tst_QSGGridView();
private slots:
+ void initTestCase();
+ void cleanupTestCase();
void items();
void changed();
void inserted();
@@ -106,7 +109,17 @@ private:
QList<T*> findItems(QSGItem *parent, const QString &objectName);
void dumpTree(QSGItem *parent, int depth = 0);
};
+void tst_QSGGridView::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("QSGGridView needs OpenGL 2.0", SkipAll);
+}
+void tst_QSGGridView::cleanupTestCase()
+{
+
+}
class TestModel : public QAbstractListModel
{
public:
diff --git a/tests/auto/declarative/qsglistview/tst_qsglistview.cpp b/tests/auto/declarative/qsglistview/tst_qsglistview.cpp
index f697e61208..507caede71 100644
--- a/tests/auto/declarative/qsglistview/tst_qsglistview.cpp
+++ b/tests/auto/declarative/qsglistview/tst_qsglistview.cpp
@@ -53,6 +53,7 @@
#include <QtDeclarative/private/qlistmodelinterface_p.h>
#include "../../../shared/util.h"
#include "incrementalmodel.h"
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -66,6 +67,8 @@ public:
tst_QSGListView();
private slots:
+ void initTestCase();
+ void cleanupTestCase();
// Test both QListModelInterface and QAbstractItemModel model types
void qListModelInterface_items();
void qAbstractItemModel_items();
@@ -133,6 +136,17 @@ private:
void dumpTree(QSGItem *parent, int depth = 0);
};
+void tst_QSGListView::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("QSGListView needs OpenGL 2.0", SkipAll);
+}
+
+void tst_QSGListView::cleanupTestCase()
+{
+
+}
class TestObject : public QObject
{
Q_OBJECT
diff --git a/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp b/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp
index 857f888c29..4e1d253c3d 100644
--- a/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp
+++ b/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp
@@ -47,6 +47,7 @@
#include <QtDeclarative/qsgview.h>
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativeengine.h>
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -57,6 +58,8 @@ class tst_QSGMouseArea: public QObject
{
Q_OBJECT
private slots:
+ void initTestCase();
+ void cleanupTestCase();
void dragProperties();
void resetDrag();
void dragging();
@@ -77,6 +80,18 @@ private:
QSGView *createView();
};
+void tst_QSGMouseArea::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("MouseArea needs OpenGL 2.0", SkipAll);
+}
+
+void tst_QSGMouseArea::cleanupTestCase()
+{
+
+}
+
void tst_QSGMouseArea::dragProperties()
{
QSGView *canvas = createView();
diff --git a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp b/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp
index df8057c4c4..5b95acec68 100644
--- a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp
+++ b/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp
@@ -55,6 +55,7 @@
#include <QStringListModel>
#include <QStandardItemModel>
#include <QFile>
+#include <QtOpenGL/QGLShaderProgram>
#include "../../../shared/util.h"
@@ -89,6 +90,8 @@ public:
tst_QSGPathView();
private slots:
+ void initTestCase();
+ void cleanupTestCase();
void initValues();
void items();
void dataModel();
@@ -121,6 +124,18 @@ private:
QList<T*> findItems(QSGItem *parent, const QString &objectName);
};
+void tst_QSGPathView::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("PathView needs OpenGL 2.0", SkipAll);
+}
+
+void tst_QSGPathView::cleanupTestCase()
+{
+
+}
+
class TestObject : public QObject
{
Q_OBJECT
diff --git a/tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp b/tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp
index 01895a69bd..b6dd1c7831 100644
--- a/tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp
+++ b/tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp
@@ -45,6 +45,7 @@
#include <private/qsgrectangle_p.h>
#include <QtDeclarative/qsgview.h>
#include <QtDeclarative/qdeclarativecontext.h>
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -55,6 +56,8 @@ class tst_QSGPinchArea: public QObject
{
Q_OBJECT
private slots:
+ void initTestCase();
+ void cleanupTestCase();
void pinchProperties();
void scale();
void pan();
@@ -62,7 +65,17 @@ private slots:
private:
QSGView *createView();
};
+void tst_QSGPinchArea::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("PinchArea needs OpenGL 2.0", SkipAll);
+}
+void tst_QSGPinchArea::cleanupTestCase()
+{
+
+}
void tst_QSGPinchArea::pinchProperties()
{
QSGView *canvas = createView();
diff --git a/tests/auto/declarative/qsgtext/tst_qsgtext.cpp b/tests/auto/declarative/qsgtext/tst_qsgtext.cpp
index 2861dd9a9f..310b132537 100644
--- a/tests/auto/declarative/qsgtext/tst_qsgtext.cpp
+++ b/tests/auto/declarative/qsgtext/tst_qsgtext.cpp
@@ -54,6 +54,7 @@
#include "../../../shared/util.h"
#include "testhttpserver.h"
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -68,6 +69,8 @@ public:
tst_qsgtext();
private slots:
+ void initTestCase();
+ void cleanupTestCase();
void text();
void width();
void wrap();
@@ -127,7 +130,17 @@ private:
QSGView *createView(const QString &filename);
};
+void tst_qsgtext::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("Text item needs OpenGL 2.0", SkipAll);
+}
+void tst_qsgtext::cleanupTestCase()
+{
+
+}
tst_qsgtext::tst_qsgtext()
{
standard << "the quick brown fox jumped over the lazy dog"
diff --git a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
index 5510701962..92053637c7 100644
--- a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
+++ b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp
@@ -60,6 +60,7 @@
#include <QMimeData>
#include <private/qapplication_p.h>
#include <private/qtextcontrol_p.h>
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_WS_MAC
#include <Carbon/Carbon.h>
@@ -97,6 +98,8 @@ public:
tst_qsgtextedit();
private slots:
+ void initTestCase();
+ void cleanupTestCase();
void text();
void width();
void wrap();
@@ -170,7 +173,17 @@ private:
QDeclarativeEngine engine;
};
+void tst_qsgtextedit::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("TextEdit item needs OpenGL 2.0", SkipAll);
+}
+void tst_qsgtextedit::cleanupTestCase()
+{
+
+}
tst_qsgtextedit::tst_qsgtextedit()
{
standard << "the quick brown fox jumped over the lazy dog"
diff --git a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
index b349de9800..5f6884b2b9 100644
--- a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
+++ b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp
@@ -51,6 +51,7 @@
#include <QStyle>
#include <QInputContext>
#include <private/qapplication_p.h>
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -83,7 +84,8 @@ public:
tst_qsgtextinput();
private slots:
-
+ void initTestCase();
+ void cleanupTestCase();
void text();
void width();
void font();
@@ -144,7 +146,17 @@ private:
QStringList standard;
QStringList colorStrings;
};
+void tst_qsgtextinput::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("TextInput item needs OpenGL 2.0", SkipAll);
+}
+void tst_qsgtextinput::cleanupTestCase()
+{
+
+}
tst_qsgtextinput::tst_qsgtextinput()
{
standard << "the quick brown fox jumped over the lazy dog"
diff --git a/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp b/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp
index 23e629538d..ce2c816dd6 100644
--- a/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp
+++ b/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp
@@ -51,6 +51,7 @@
#include <private/qsgvisualitemmodel_p.h>
#include <private/qdeclarativevaluetype_p.h>
#include <math.h>
+#include <QtOpenGL/QGLShaderProgram>
#ifdef Q_OS_SYMBIAN
// In Symbian OS test data is located in applications private dir
@@ -115,6 +116,8 @@ public:
tst_qsgvisualdatamodel();
private slots:
+ void initTestCase();
+ void cleanupTestCase();
void rootIndex();
void updateLayout();
void childChanged();
@@ -128,7 +131,17 @@ private:
template<typename T>
T *findItem(QSGItem *parent, const QString &objectName, int index);
};
+void tst_qsgvisualdatamodel::initTestCase()
+{
+ QSGView canvas;
+ if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
+ QSKIP("VisualDatamodel item needs OpenGL 2.0", SkipAll);
+}
+void tst_qsgvisualdatamodel::cleanupTestCase()
+{
+
+}
class DataObject : public QObject
{
Q_OBJECT