Skip tst_QQuickFramebufferObject if OpenGL is not available at runtime

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I6dfa9c0abf4bef736c39caee578b630efdea748d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2025-09-12 17:03:01 +02:00
parent 0e2b013e1b
commit 11cc077da6
2 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,7 @@ qt_internal_add_test(tst_qquickframebufferobject
tst_qquickframebufferobject.cpp
LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Quick
Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}

View File

@ -10,6 +10,9 @@
#include <qopenglframebufferobject.h>
#include <qopenglfunctions.h>
#include <qpa/qplatformintegration.h>
#include <private/qguiapplication_p.h>
#include <QtQuick/QQuickFramebufferObject>
#include <QtQuickTestUtils/private/qmlutils_p.h>
@ -136,6 +139,9 @@ tst_QQuickFramebufferObject::tst_QQuickFramebufferObject()
void tst_QQuickFramebufferObject::initTestCase()
{
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL))
QSKIP("OpenGL is not enabled in this configuration");
QQmlDataTest::initTestCase();
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
}