summaryrefslogtreecommitdiffstats
path: root/tests/auto/opengl
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-10-26 16:12:27 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-27 11:14:44 +0200
commite822eb1a658346165ed1923f667cdc7232f5d4c2 (patch)
treef679cea32ca3b1a60c077be58ddb64d597cbb3ea /tests/auto/opengl
parent1bc8f124b8c45daa391205eef12746a64473c8f9 (diff)
Use standard method of excluding a test.
If we find out at run-time that an entire test program is not applicable, the correct way to skip the test is by calling QSKIP from the test's initTestCase() method. Change-Id: Iaf1dbcce38c569ee9513bf37232e9e4ea287d872 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/opengl')
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp44
1 files changed, 9 insertions, 35 deletions
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index c9b4800b53..9f11746d75 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -73,6 +73,7 @@ public:
virtual ~tst_QGL();
private slots:
+ void initTestCase();
void getSetCheck();
void openGLVersionCheck();
void graphicsViewClipping();
@@ -108,6 +109,13 @@ tst_QGL::~tst_QGL()
{
}
+void tst_QGL::initTestCase()
+{
+ QGLWidget glWidget;
+ if (!glWidget.isValid())
+ QSKIP("QGL is not supported on the test system");
+}
+
class MyGLContext : public QGLContext
{
public:
@@ -144,9 +152,6 @@ static int appDefaultDepth()
// Testing get/set functions
void tst_QGL::getSetCheck()
{
- if (!QGLFormat::hasOpenGL())
- QSKIP("QGL not supported on this platform");
-
QGLFormat obj1;
// int QGLFormat::depthBufferSize()
// void QGLFormat::setDepthBufferSize(int)
@@ -655,9 +660,6 @@ QT_END_NAMESPACE
void tst_QGL::openGLVersionCheck()
{
#ifdef QT_BUILD_INTERNAL
- if (!QGLFormat::hasOpenGL())
- QSKIP("QGL not supported on this platform");
-
QString versionString;
QGLFormat::OpenGLVersionFlags expectedFlag;
QGLFormat::OpenGLVersionFlags versionFlag;
@@ -894,9 +896,6 @@ void tst_QGL::partialGLWidgetUpdates_data()
void tst_QGL::partialGLWidgetUpdates()
{
- if (!QGLFormat::hasOpenGL())
- QSKIP("QGL not supported on this platform");
-
QFETCH(bool, doubleBufferedContext);
QFETCH(bool, autoFillBackground);
QFETCH(bool, supportsPartialUpdates);
@@ -2371,30 +2370,5 @@ void tst_QGL::nullRectCrash()
fboPainter.end();
}
-class tst_QGLDummy : public QObject
-{
-Q_OBJECT
-
-public:
- tst_QGLDummy() {}
-
-private slots:
- void qglSkipTests() {
- QSKIP("QGL not supported on this system.");
- }
-};
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
- QTEST_DISABLE_KEYPAD_NAVIGATION \
- QGLWidget glWidget;
- if (!glWidget.isValid()) {
- tst_QGLDummy tc;
- return QTest::qExec(&tc, argc, argv);
- }
- tst_QGL tc;
- return QTest::qExec(&tc, argc, argv);
-}
-
+QTEST_MAIN(tst_QGL)
#include "tst_qgl.moc"