Skip testing of QOpenGLWidget on platforms that don't support it

QOpenGLWidget is not supported on all platforms. Skip tests on those.

Change-Id: I0f9500553427903f20d248acaa20803276e3ab00
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
bb10
Sami Nurmenniemi 2017-03-30 17:46:52 +03:00
parent 08fc4c4e95
commit cd8d2c1743
1 changed files with 10 additions and 0 deletions

View File

@ -39,12 +39,15 @@
#include <QtWidgets/QStackedWidget>
#include <QtTest/QtTest>
#include <QSignalSpy>
#include <private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
class tst_QOpenGLWidget : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void create();
void clearAndGrab();
void clearAndResizeAndGrab();
@ -60,6 +63,13 @@ private slots:
void stackWidgetOpaqueChildIsVisible();
};
void tst_QOpenGLWidget::initTestCase()
{
// See QOpenGLWidget constructor
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface))
QSKIP("QOpenGLWidget is not supported on this platform.");
}
void tst_QOpenGLWidget::create()
{
QScopedPointer<QOpenGLWidget> w(new QOpenGLWidget);