summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSami Nurmenniemi <sami.nurmenniemi@qt.io>2017-03-31 16:18:12 +0300
committerSami Nurmenniemi <sami.nurmenniemi@qt.io>2017-04-04 11:06:38 +0000
commit6d6a826038e5a3fae13580e84159b99c928dc006 (patch)
treeaa8180d46af472a0b847527783ce565fa4622470 /tests
parent5377f4ec0e82dbfbd0d148ed3affc0c7b2a3cade (diff)
Skip OpenGL tests on platforms that don't support OpenGL
Change-Id: Iff38950a940d602fbfcc35595624e56399aab53a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp9
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp7
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp5
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
index b130210447..58dee6f6ca 100644
--- a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
+++ b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
@@ -31,12 +31,15 @@
#include <QtGui/QOpenGLFunctions>
#include <QtGui/QOpenGLContext>
#include <QtGui/QPainter>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
class tst_QOpenGLWindow : public QObject
{
Q_OBJECT
private slots:
+ void initTestCase();
void create();
void basic();
void painter();
@@ -45,6 +48,12 @@ private slots:
void underOver();
};
+void tst_QOpenGLWindow::initTestCase()
+{
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL))
+ QSKIP("OpenGL is not supported on this platform.");
+}
+
void tst_QOpenGLWindow::create()
{
QOpenGLWindow w;
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index 7451ef92ee..87d93e0827 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -67,6 +67,7 @@ class tst_QOpenGL : public QObject
Q_OBJECT
private slots:
+ void initTestCase();
void sharedResourceCleanup_data();
void sharedResourceCleanup();
void multiGroupSharedResourceCleanup_data();
@@ -205,6 +206,12 @@ static QSurface *createSurface(int surfaceClass)
return 0;
}
+void tst_QOpenGL::initTestCase()
+{
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL))
+ QSKIP("OpenGL is not supported on this platform.");
+}
+
static void common_data()
{
QTest::addColumn<int>("surfaceClass");
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 5ab24d6878..76b25cdb52 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -56,6 +56,8 @@
#include <private/qgraphicsview_p.h>
#include "../../../shared/platforminputcontext.h"
#include <private/qinputmethod_p.h>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
#include "tst_qgraphicsview.h"
@@ -664,6 +666,9 @@ void tst_QGraphicsView::viewport()
#ifndef QT_NO_OPENGL
void tst_QGraphicsView::openGLViewport()
{
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL))
+ QSKIP("QOpenGL is not supported on this platform.");
+
QGraphicsScene scene;
scene.setBackgroundBrush(Qt::white);
scene.addText("GraphicsView");