diff options
-rw-r--r-- | tests/auto/quick/geometry/tst_geometry.cpp | 6 | ||||
-rw-r--r-- | tests/auto/quick/nokeywords/tst_nokeywords.cpp | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 4 | ||||
-rw-r--r-- | tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp | 4 | ||||
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 46 | ||||
-rw-r--r-- | tests/auto/quick/quick.pro | 17 | ||||
-rw-r--r-- | tests/auto/quick/scenegraph/tst_scenegraph.cpp | 20 | ||||
-rw-r--r-- | tests/benchmarks/benchmarks.pro | 2 |
8 files changed, 68 insertions, 33 deletions
diff --git a/tests/auto/quick/geometry/tst_geometry.cpp b/tests/auto/quick/geometry/tst_geometry.cpp index 7988b6b515..470ce3bd91 100644 --- a/tests/auto/quick/geometry/tst_geometry.cpp +++ b/tests/auto/quick/geometry/tst_geometry.cpp @@ -126,9 +126,9 @@ void GeometryTest::testCustomGeometry() }; static QSGGeometry::Attribute attributes[] = { - QSGGeometry::Attribute::create(0, 2, GL_FLOAT, false), - QSGGeometry::Attribute::create(1, 4, GL_UNSIGNED_BYTE, false), - QSGGeometry::Attribute::create(2, 4, GL_FLOAT, false) + QSGGeometry::Attribute::create(0, 2, QSGGeometry::TypeFloat, false), + QSGGeometry::Attribute::create(1, 4, QSGGeometry::TypeUnsignedByte, false), + QSGGeometry::Attribute::create(2, 4, QSGGeometry::TypeFloat, false) }; static QSGGeometry::AttributeSet set = { 4, 6 * sizeof(float) + 4 * sizeof(unsigned char), attributes }; diff --git a/tests/auto/quick/nokeywords/tst_nokeywords.cpp b/tests/auto/quick/nokeywords/tst_nokeywords.cpp index ffe76cc210..e25cd9535b 100644 --- a/tests/auto/quick/nokeywords/tst_nokeywords.cpp +++ b/tests/auto/quick/nokeywords/tst_nokeywords.cpp @@ -48,6 +48,7 @@ #include <QtQuick/private/qsgadaptationlayer_p.h> #include <QtQuick/private/qsgcontext_p.h> #include <QtQuick/private/qsgcontextplugin_p.h> +#ifndef QT_NO_OPENGL #include <QtQuick/private/qsgdefaultdistancefieldglyphcache_p.h> #include <QtQuick/private/qsgdefaultglyphnode_p.h> #include <QtQuick/private/qsgdefaultimagenode_p.h> @@ -55,6 +56,7 @@ #include <QtQuick/private/qsgdepthstencilbuffer_p.h> #include <QtQuick/private/qsgdistancefieldglyphnode_p.h> #include <QtQuick/private/qsgdistancefieldutil_p.h> +#endif #include <QtQuick/private/qsggeometry_p.h> #include <QtQuick/private/qsgnode_p.h> #include <QtQuick/private/qsgnodeupdater_p.h> diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp index 62ff09e698..de61d7aea9 100644 --- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp @@ -3017,7 +3017,7 @@ void tst_QQuickItem::grab() QVERIFY(root); QQuickItem *item = root->findChild<QQuickItem *>("myItem"); QVERIFY(item); - +#ifndef QT_NO_OPENGL { // Default size (item is 100x100) QSharedPointer<QQuickItemGrabResult> result = item->grabToImage(); QSignalSpy spy(result.data(), SIGNAL(ready())); @@ -3038,7 +3038,7 @@ void tst_QQuickItem::grab() QCOMPARE(image.pixel(0, 0), qRgb(255, 0, 0)); QCOMPARE(image.pixel(49, 49), qRgb(0, 0, 255)); } - +#endif } void tst_QQuickItem::isAncestorOf() diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp index 92b7196919..6cfe43fd9f 100644 --- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp +++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp @@ -102,6 +102,7 @@ void tst_QQuickItemLayer::initTestCase() { QQmlDataTest::initTestCase(); QWindow window; +#ifndef QT_NO_OPENGL QOpenGLContext context; window.setSurfaceType(QWindow::OpenGLSurface); window.create(); @@ -129,6 +130,9 @@ void tst_QQuickItemLayer::initTestCase() m_mesaVersion = QT_VERSION_CHECK(major, minor, patch); } } +#else + window.create(); +#endif } // The test draws a red and a blue box next to each other and tests that the diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 3e661db7b1..eed81389f6 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -291,8 +291,9 @@ private slots: QWindowSystemInterface::registerTouchDevice(touchDeviceWithVelocity); } void cleanup(); - +#ifndef QT_NO_OPENGL void openglContextCreatedSignal(); +#endif void aboutToStopSignal(); void constantUpdates(); @@ -371,14 +372,14 @@ private: QTouchDevice *touchDevice; QTouchDevice *touchDeviceWithVelocity; }; - +#ifndef QT_NO_OPENGL Q_DECLARE_METATYPE(QOpenGLContext *); - +#endif void tst_qquickwindow::cleanup() { QVERIFY(QGuiApplication::topLevelWindows().isEmpty()); } - +#ifndef QT_NO_OPENGL void tst_qquickwindow::openglContextCreatedSignal() { qRegisterMetaType<QOpenGLContext *>(); @@ -395,7 +396,7 @@ void tst_qquickwindow::openglContextCreatedSignal() QVariant ctx = spy.at(0).at(0); QCOMPARE(qvariant_cast<QOpenGLContext *>(ctx), window.openglContext()); } - +#endif void tst_qquickwindow::aboutToStopSignal() { QQuickWindow window; @@ -437,8 +438,11 @@ void tst_qquickwindow::constantUpdatesOnWindow_data() window.setGeometry(100, 100, 300, 200); window.show(); QTest::qWaitForWindowExposed(&window); +#ifndef QT_NO_OPENGL bool threaded = window.openglContext()->thread() != QGuiApplication::instance()->thread(); - +#else + bool threaded = false; +#endif if (threaded) { QTest::newRow("blocked, beforeRender") << true << QByteArray(SIGNAL(beforeRendering())); QTest::newRow("blocked, afterRender") << true << QByteArray(SIGNAL(afterRendering())); @@ -1228,8 +1232,11 @@ void tst_qquickwindow::headless() QVERIFY(QTest::qWaitForWindowExposed(window)); QVERIFY(window->isVisible()); +#ifndef QT_NO_OPENGL bool threaded = window->openglContext()->thread() != QThread::currentThread(); - +#else + bool threaded = false; +#endif QSignalSpy initialized(window, SIGNAL(sceneGraphInitialized())); QSignalSpy invalidated(window, SIGNAL(sceneGraphInvalidated())); @@ -1247,12 +1254,12 @@ void tst_qquickwindow::headless() QTRY_COMPARE(invalidated.size(), 1); QVERIFY(!window->openglContext()); } - +#ifndef QT_NO_OPENGL if (QGuiApplication::platformName() == QLatin1String("windows") && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) { QSKIP("Crashes on Windows/ANGLE, QTBUG-42967"); } - +#endif // Destroy the native windowing system buffers window->destroy(); QVERIFY(!window->handle()); @@ -1284,11 +1291,14 @@ void tst_qquickwindow::noUpdateWhenNothingChanges() // the initial expose with a second expose or more. Let these go // through before we let the test continue. QTest::qWait(100); - +#ifndef QT_NO_OPENGL if (window.openglContext()->thread() == QGuiApplication::instance()->thread()) { QSKIP("Only threaded renderloop implements this feature"); return; } +#else + return; +#endif QSignalSpy spy(&window, SIGNAL(frameSwapped())); rect.update(); @@ -1607,15 +1617,16 @@ void tst_qquickwindow::hideThenDelete() window.show(); QTest::qWaitForWindowExposed(&window); +#ifndef QT_NO_OPENGL threaded = window.openglContext()->thread() != QThread::currentThread(); - openglDestroyed = new QSignalSpy(window.openglContext(), SIGNAL(aboutToBeDestroyed())); +#endif sgInvalidated = new QSignalSpy(&window, SIGNAL(sceneGraphInvalidated())); window.hide(); QTRY_VERIFY(!window.isExposed()); - +#ifndef QT_NO_OPENGL if (threaded) { if (!persistentSG) { QVERIFY(sgInvalidated->size() > 0); @@ -1628,6 +1639,7 @@ void tst_qquickwindow::hideThenDelete() QCOMPARE(openglDestroyed->size(), 0); } } +#endif } QVERIFY(sgInvalidated->size() > 0); @@ -2014,12 +2026,13 @@ void tst_qquickwindow::defaultSurfaceFormat() QCOMPARE(format.profile(), reqFmt.profile()); QCOMPARE(int(format.options()), int(reqFmt.options())); +#ifndef QT_NO_OPENGL // Depth and stencil should be >= what has been requested. For real. But use // the context since the window's surface format is only partially updated // on most platforms. QVERIFY(window.openglContext()->format().depthBufferSize() >= 16); QVERIFY(window.openglContext()->format().stencilBufferSize() >= 8); - +#endif QSurfaceFormat::setDefaultFormat(savedDefaultFormat); } @@ -2068,7 +2081,7 @@ public: } static int deleted; }; - +#ifndef QT_NO_OPENGL class GlRenderJob : public QRunnable { public: @@ -2090,7 +2103,7 @@ public: QMutex *mutex; QWaitCondition *condition; }; - +#endif int RenderJob::deleted = 0; void tst_qquickwindow::testRenderJob() @@ -2139,6 +2152,7 @@ void tst_qquickwindow::testRenderJob() QTRY_COMPARE(RenderJob::deleted, 1); QCOMPARE(completedJobs.size(), 1); +#ifndef QT_NO_OPENGL // Do a synchronized GL job. GLubyte readPixel[4] = {0, 0, 0, 0}; GlRenderJob *glJob = new GlRenderJob(readPixel); @@ -2158,8 +2172,8 @@ void tst_qquickwindow::testRenderJob() QCOMPARE(int(readPixel[1]), 0); QCOMPARE(int(readPixel[2]), 0); QCOMPARE(int(readPixel[3]), 255); +#endif } - // Verify that jobs are deleted when window is not rendered at all completedJobs.clear(); RenderJob::deleted = 0; diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index 45c6e2fdaf..e1ed4418f1 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -2,10 +2,19 @@ TEMPLATE = subdirs PUBLICTESTS += \ geometry \ - rendernode \ qquickpixmapcache -qtHaveModule(widgets): PUBLICTESTS += nodes +contains(QT_CONFIG, opengl(es1|es2)?) { + PUBLICTESTS += \ + rendernode + qtHaveModule(widgets): PUBLICTESTS += nodes + + QUICKTESTS += \ + qquickanimatedsprite \ + qquickframebufferobject \ + qquickopenglinfo \ + qquickspritesequence +} !cross_compile: PRIVATETESTS += examples @@ -39,7 +48,6 @@ QUICKTESTS = \ qquickaccessible \ qquickanchors \ qquickanimatedimage \ - qquickanimatedsprite \ qquickdynamicpropertyanimation \ qquickborderimage \ qquickwindow \ @@ -48,7 +56,6 @@ QUICKTESTS = \ qquickflickable \ qquickflipable \ qquickfocusscope \ - qquickframebufferobject \ qquickgridview \ qquickimage \ qquickitem \ @@ -58,7 +65,6 @@ QUICKTESTS = \ qquickloader \ qquickmousearea \ qquickmultipointtoucharea \ - qquickopenglinfo \ qquickpainteditem \ qquickpathview \ qquickpincharea \ @@ -68,7 +74,6 @@ QUICKTESTS = \ qquickrepeater \ qquickshadereffect \ qquickshortcut \ - qquickspritesequence \ qquicktext \ qquicktextdocument \ qquicktextedit \ diff --git a/tests/auto/quick/scenegraph/tst_scenegraph.cpp b/tests/auto/quick/scenegraph/tst_scenegraph.cpp index 1cca56a876..6f00d5f9f2 100644 --- a/tests/auto/quick/scenegraph/tst_scenegraph.cpp +++ b/tests/auto/quick/scenegraph/tst_scenegraph.cpp @@ -28,18 +28,22 @@ #include <qtest.h> +#ifndef QT_NO_OPENGL #include <QOffscreenSurface> #include <QOpenGLContext> #include <QOpenGLFunctions> +#endif #include <QtQuick> #include <QtQml> +#ifndef QT_NO_OPENGL #include <private/qopenglcontext_p.h> +#endif + #include <private/qsgcontext_p.h> #include <private/qsgrenderloop_p.h> - class PerPixelRect : public QQuickItem { Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) @@ -96,9 +100,9 @@ private slots: void render_data(); void render(); - +#ifndef QT_NO_OPENGL void hideWithOtherContext(); - +#endif void createTextureFromImage_data(); void createTextureFromImage(); @@ -118,6 +122,7 @@ void tst_SceneGraph::initTestCase() QSGRenderLoop *loop = QSGRenderLoop::instance(); qDebug() << "RenderLoop: " << loop; +#ifndef QT_NO_OPENGL QOpenGLContext context; context.setFormat(loop->sceneGraphContext()->defaultSurfaceFormat()); context.create(); @@ -150,6 +155,7 @@ void tst_SceneGraph::initTestCase() qDebug() << "Broken Mipmap: " << m_brokenMipmapSupport; context.doneCurrent(); +#endif } QQuickView *createView(const QString &file, QWindow *parent = 0, int x = -1, int y = -1, int w = -1, int h = -1) @@ -251,24 +257,26 @@ void tst_SceneGraph::manyWindows_data() QTest::newRow("rects,subwindow,sharing") << QStringLiteral("manyWindows_rects.qml") << false << true; } +#ifndef QT_NO_OPENGL struct ShareContextResetter { public: ~ShareContextResetter() { qt_gl_set_global_share_context(0); } }; +#endif void tst_SceneGraph::manyWindows() { QFETCH(QString, file); QFETCH(bool, toplevel); QFETCH(bool, shared); - +#ifndef QT_NO_OPENGL QOpenGLContext sharedGLContext; ShareContextResetter cleanup; // To avoid dangling pointer in case of test-failure. if (shared) { QVERIFY(sharedGLContext.create()); qt_gl_set_global_share_context(&sharedGLContext); } - +#endif QScopedPointer<QWindow> parent; if (!toplevel) { parent.reset(new QWindow()); @@ -499,6 +507,7 @@ void tst_SceneGraph::render() } } +#ifndef QT_NO_OPENGL // Testcase for QTBUG-34898. We make another context current on another surface // in the GUI thread and hide the QQuickWindow while the other context is // current on the other window. @@ -531,6 +540,7 @@ void tst_SceneGraph::hideWithOtherContext() // GL calls to a new frame (see QOpenGLContext docs). QVERIFY(!renderingOnMainThread || QOpenGLContext::currentContext() != &context); } +#endif void tst_SceneGraph::createTextureFromImage_data() { diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro index c7e7c6829a..bd071ecf5c 100644 --- a/tests/benchmarks/benchmarks.pro +++ b/tests/benchmarks/benchmarks.pro @@ -1,5 +1,5 @@ TEMPLATE = subdirs SUBDIRS = qml script contains(QT_CONFIG, private_tests) { - SUBDIRS += particles + contains(QT_CONFIG, opengl(es1|es2)?):SUBDIRS += particles } |