From: Charles Yin Date: Mon, 16 May 2011 03:49:56 +0000 (+1000) Subject: skip unit tests if no required OpenGL 2.0 feature on this platform X-Git-Tag: qt-v5.0.0-alpha1~2170^2~98^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7740c4c9a1a3cba3fec26e8995bfc8af9f94cd06;p=profile%2Fivi%2Fqtdeclarative.git skip unit tests if no required OpenGL 2.0 feature on this platform Change-Id: I68feb5938339f327b45cf66b7aec1c582753f18d --- diff --git a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp index 2cc6b3e..1892350 100644 --- a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp +++ b/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp @@ -47,6 +47,7 @@ #include #include #include "../../../shared/util.h" +#include #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 205c2ce..a5e8105 100644 --- a/tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp +++ b/tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp @@ -47,6 +47,8 @@ #include #include #include +#include + #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 c793ce9..98ed425 100644 --- a/tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp +++ b/tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #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 931ae7e..7374479 100644 --- a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp +++ b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp @@ -52,6 +52,7 @@ #include #include #include "../../../shared/util.h" +#include #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 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 f697e61..507caed 100644 --- a/tests/auto/declarative/qsglistview/tst_qsglistview.cpp +++ b/tests/auto/declarative/qsglistview/tst_qsglistview.cpp @@ -53,6 +53,7 @@ #include #include "../../../shared/util.h" #include "incrementalmodel.h" +#include #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 857f888..4e1d253 100644 --- a/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp +++ b/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #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 df8057c..5b95ace 100644 --- a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp +++ b/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #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 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 01895a6..b6dd1c7 100644 --- a/tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp +++ b/tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #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 2861dd9..310b132 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 #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 5510701..9205363 100644 --- a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp +++ b/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp @@ -60,6 +60,7 @@ #include #include #include +#include #ifdef Q_WS_MAC #include @@ -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 b349de9..5f6884b 100644 --- a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp +++ b/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #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 23e6295..ce2c816 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp +++ b/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #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 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