aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2021-06-04 11:50:03 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2021-06-08 20:59:26 +0200
commitb5b0a39a2aa3ec98e221bc2ef0080d9b879304d5 (patch)
tree8d7cd4300544c90a0868a02d2d3c55ed19ca4922
parentef7544bb5c6156462d169954c55afd38141e5a74 (diff)
Add missing Quick autotests to CMakeLists
Restore autotests that went missing in the tests/auto/quick project file during the qmake->CMake conversion. Adjust the conditions as relevant for Qt 6, e.g. the qmake project still had some now-unnecessary OpenGL and Widgets conditions. The rendernode test has not been fully migrated to Qt 6 and it's pretty much just QSKIPs for now. This is to be remedied at a later point. The drawingmodes test gets one test disabled for macOS due to unexpected results in the Apple M1 CI configuration (which now has Metal, unlike other the Intel macOS VMs), to be checked later. Do some necessary source code changes as well. Some of these tests did not even compile since they were not exercised in the CI for some time now. Change-Id: Ibcdd7d61f72165ce1c11847d02635340be0c44b1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
-rw-r--r--tests/auto/quick/CMakeLists.txt12
-rw-r--r--tests/auto/quick/drawingmodes/tst_drawingmodes.cpp24
-rw-r--r--tests/auto/quick/nodes/tst_nodestest.cpp2
-rw-r--r--tests/auto/quick/rendernode/tst_rendernode.cpp3
4 files changed, 26 insertions, 15 deletions
diff --git a/tests/auto/quick/CMakeLists.txt b/tests/auto/quick/CMakeLists.txt
index b4e34734c4..8c2c926111 100644
--- a/tests/auto/quick/CMakeLists.txt
+++ b/tests/auto/quick/CMakeLists.txt
@@ -1,7 +1,10 @@
# Generated from quick.pro.
add_subdirectory(geometry)
+add_subdirectory(nodes)
+add_subdirectory(drawingmodes)
add_subdirectory(qquickpixmapcache)
+
if(QT_FEATURE_private_tests)
add_subdirectory(nokeywords)
add_subdirectory(propertyrequirements)
@@ -71,4 +74,13 @@ if(QT_FEATURE_private_tests)
add_subdirectory(sharedimage)
add_subdirectory(qquickcolorgroup)
add_subdirectory(qquickpalette)
+ add_subdirectory(qquickrendercontrol)
+ add_subdirectory(qquickshadereffect)
+ add_subdirectory(qquickanimatedsprite)
+ add_subdirectory(qquickspritesequence)
+
+ if(QT_FEATURE_opengl)
+ add_subdirectory(qquickframebufferobject)
+ add_subdirectory(rendernode)
+ endif()
endif()
diff --git a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
index 2419d8ca25..57c4bee118 100644
--- a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
+++ b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp
@@ -34,7 +34,6 @@
#include <QtQuick/qsggeometry.h>
#include <QtQuick/qsgflatcolormaterial.h>
#include <QtGui/qscreen.h>
-#include <qopenglcontext.h>
#include "../../shared/util.h"
@@ -78,7 +77,7 @@ class DrawingModeItem : public QQuickItem
{
Q_OBJECT
public:
- static GLenum drawingMode;
+ static QSGGeometry::DrawingMode drawingMode;
DrawingModeItem() : first(QSGGeometry::defaultAttributes_Point2D(), 5),
second(QSGGeometry::defaultAttributes_Point2D(), 5)
@@ -127,7 +126,7 @@ protected:
}
};
-GLenum DrawingModeItem::drawingMode;
+QSGGeometry::DrawingMode DrawingModeItem::drawingMode;
bool tst_drawingmodes::hasPixelAround(const QImage &fb, int centerX, int centerY) {
for (int x = centerX - 2; x <= centerX + 2; ++x) {
@@ -148,7 +147,7 @@ tst_drawingmodes::tst_drawingmodes() : black(qRgb(0, 0, 0)), red(qRgb(0xff, 0, 0
void tst_drawingmodes::points()
{
- DrawingModeItem::drawingMode = GL_POINTS;
+ DrawingModeItem::drawingMode = QSGGeometry::DrawPoints;
if (QGuiApplication::primaryScreen()->depth() < 24)
QSKIP("This test does not work at display depths < 24");
@@ -156,9 +155,8 @@ void tst_drawingmodes::points()
|| (QGuiApplication::platformName() == QLatin1String("minimal")))
QSKIP("Skipping due to grabWindow not functional on offscreen/minimal platforms");
-#ifdef Q_OS_WIN
- if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES)
- QSKIP("ANGLE cannot draw GL_POINTS.");
+#if defined(Q_OS_MACOS) || defined(Q_OS_IOS)
+ QSKIP("Skipping points test due to unexpected failures in M1 CI VM");
#endif
QImage fb = runTest("DrawingModes.qml");
@@ -191,7 +189,7 @@ void tst_drawingmodes::points()
void tst_drawingmodes::lines()
{
- DrawingModeItem::drawingMode = GL_LINES;
+ DrawingModeItem::drawingMode = QSGGeometry::DrawLines;
if (QGuiApplication::primaryScreen()->depth() < 24)
QSKIP("This test does not work at display depths < 24");
@@ -222,7 +220,7 @@ void tst_drawingmodes::lines()
void tst_drawingmodes::lineStrip()
{
- DrawingModeItem::drawingMode = GL_LINE_STRIP;
+ DrawingModeItem::drawingMode = QSGGeometry::DrawLineStrip;
if (QGuiApplication::primaryScreen()->depth() < 24)
QSKIP("This test does not work at display depths < 24");
@@ -255,7 +253,7 @@ void tst_drawingmodes::lineStrip()
void tst_drawingmodes::lineLoop()
{
- DrawingModeItem::drawingMode = GL_LINE_LOOP;
+ DrawingModeItem::drawingMode = QSGGeometry::DrawLineLoop;
if (QGuiApplication::primaryScreen()->depth() < 24)
QSKIP("This test does not work at display depths < 24");
@@ -291,7 +289,7 @@ void tst_drawingmodes::lineLoop()
void tst_drawingmodes::triangles()
{
- DrawingModeItem::drawingMode = GL_TRIANGLES;
+ DrawingModeItem::drawingMode = QSGGeometry::DrawTriangles;
if (QGuiApplication::primaryScreen()->depth() < 24)
QSKIP("This test does not work at display depths < 24");
@@ -320,7 +318,7 @@ void tst_drawingmodes::triangles()
void tst_drawingmodes::triangleStrip()
{
- DrawingModeItem::drawingMode = GL_TRIANGLE_STRIP;
+ DrawingModeItem::drawingMode = QSGGeometry::DrawTriangleStrip;
if (QGuiApplication::primaryScreen()->depth() < 24)
QSKIP("This test does not work at display depths < 24");
@@ -348,7 +346,7 @@ void tst_drawingmodes::triangleStrip()
void tst_drawingmodes::triangleFan()
{
- DrawingModeItem::drawingMode = GL_TRIANGLE_FAN;
+ DrawingModeItem::drawingMode = QSGGeometry::DrawTriangleFan;
if (QGuiApplication::primaryScreen()->depth() < 24)
QSKIP("This test does not work at display depths < 24");
diff --git a/tests/auto/quick/nodes/tst_nodestest.cpp b/tests/auto/quick/nodes/tst_nodestest.cpp
index fa53ebfa02..af2121f6a5 100644
--- a/tests/auto/quick/nodes/tst_nodestest.cpp
+++ b/tests/auto/quick/nodes/tst_nodestest.cpp
@@ -83,7 +83,7 @@ public:
NodesTest();
private Q_SLOTS:
- void initTestCase() override;
+ void initTestCase();
void cleanupTestCase();
// Root nodes
diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp
index 46f9af7510..98d0970ca0 100644
--- a/tests/auto/quick/rendernode/tst_rendernode.cpp
+++ b/tests/auto/quick/rendernode/tst_rendernode.cpp
@@ -299,7 +299,8 @@ class StateRecordingRenderNodeItem : public QQuickItem
Q_OBJECT
public:
StateRecordingRenderNodeItem() { setFlag(ItemHasContents, true); }
- QSGNode *updatePaintNode(QSGNode *r, UpdatePaintNodeData *) {
+ QSGNode *updatePaintNode(QSGNode *r, UpdatePaintNodeData *) override
+ {
if (r)
return r;
StateRecordingRenderNode *rn = new StateRecordingRenderNode();