aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickframebufferobject
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickframebufferobject')
-rw-r--r--tests/auto/quick/qquickframebufferobject/BLACKLIST5
-rw-r--r--tests/auto/quick/qquickframebufferobject/CMakeLists.txt19
-rw-r--r--tests/auto/quick/qquickframebufferobject/data/testStuff.qml29
-rw-r--r--tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp55
4 files changed, 40 insertions, 68 deletions
diff --git a/tests/auto/quick/qquickframebufferobject/BLACKLIST b/tests/auto/quick/qquickframebufferobject/BLACKLIST
index 93dd7e9d1c..1e814c5ebe 100644
--- a/tests/auto/quick/qquickframebufferobject/BLACKLIST
+++ b/tests/auto/quick/qquickframebufferobject/BLACKLIST
@@ -1,4 +1,3 @@
-# QTBUG-65614
-b2qt
+# QTBUG-102721
[testThatStuffWorks]
-b2qt
+android
diff --git a/tests/auto/quick/qquickframebufferobject/CMakeLists.txt b/tests/auto/quick/qquickframebufferobject/CMakeLists.txt
index 9f242842e6..9d87a5703d 100644
--- a/tests/auto/quick/qquickframebufferobject/CMakeLists.txt
+++ b/tests/auto/quick/qquickframebufferobject/CMakeLists.txt
@@ -1,9 +1,18 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# Generated from qquickframebufferobject.pro.
#####################################################################
## tst_qquickframebufferobject Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qquickframebufferobject LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
# Collect test data
file(GLOB_RECURSE test_data_glob
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
@@ -12,13 +21,11 @@ list(APPEND test_data ${test_data_glob})
qt_internal_add_test(tst_qquickframebufferobject
SOURCES
- ../../shared/util.cpp ../../shared/util.h
tst_qquickframebufferobject.cpp
- INCLUDE_DIRECTORIES
- ../../shared
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Quick
+ Qt::QuickTestUtilsPrivate
TESTDATA ${test_data}
)
@@ -30,10 +37,10 @@ qt_internal_add_test(tst_qquickframebufferobject
qt_internal_extend_target(tst_qquickframebufferobject CONDITION ANDROID OR IOS
DEFINES
- QT_QMLTEST_DATADIR=\\\":/data\\\"
+ QT_QMLTEST_DATADIR=":/data"
)
qt_internal_extend_target(tst_qquickframebufferobject CONDITION NOT ANDROID AND NOT IOS
DEFINES
- QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\"
+ QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data"
)
diff --git a/tests/auto/quick/qquickframebufferobject/data/testStuff.qml b/tests/auto/quick/qquickframebufferobject/data/testStuff.qml
index c93909a337..fbde7ecc93 100644
--- a/tests/auto/quick/qquickframebufferobject/data/testStuff.qml
+++ b/tests/auto/quick/qquickframebufferobject/data/testStuff.qml
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tests of the QtQuick module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.0
import FBOItem 1.0
diff --git a/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp b/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp
index 5a77215624..ffd6478f9c 100644
--- a/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp
+++ b/tests/auto/quick/qquickframebufferobject/tst_qquickframebufferobject.cpp
@@ -1,33 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
+#include <QGuiApplication>
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickview.h>
#include <qopenglcontext.h>
@@ -36,7 +12,7 @@
#include <QtQuick/QQuickFramebufferObject>
-#include "../../shared/util.h"
+#include <QtQuickTestUtils/private/qmlutils_p.h>
#ifndef GL_MAX_SAMPLES
#define GL_MAX_SAMPLES 0x8D57
@@ -53,9 +29,9 @@ struct FrameInfo {
class ColorRenderer : public QQuickFramebufferObject::Renderer, protected QOpenGLFunctions
{
public:
- void render();
- void synchronize(QQuickFramebufferObject *item);
- QOpenGLFramebufferObject *createFramebufferObject(const QSize &size);
+ void render() override;
+ void synchronize(QQuickFramebufferObject *item) override;
+ QOpenGLFramebufferObject *createFramebufferObject(const QSize &size) override;
QSize textureSize;
QColor color;
@@ -72,7 +48,7 @@ class FBOItem : public QQuickFramebufferObject
Q_PROPERTY(QSize textureSize READ textureSize WRITE setTextureSize NOTIFY textureSizeChanged)
public:
- Renderer *createRenderer() const { return new ColorRenderer(); }
+ Renderer *createRenderer() const override { return new ColorRenderer(); }
void setColor(const QColor &color) { m_color = color; colorChanged(m_color); }
QColor color() const { return m_color; }
@@ -143,6 +119,8 @@ class tst_QQuickFramebufferObject: public QQmlDataTest
{
Q_OBJECT
public:
+ tst_QQuickFramebufferObject();
+
private slots:
void initTestCase() override;
void testThatStuffWorks_data();
@@ -151,6 +129,11 @@ private slots:
void testInvalidate();
};
+tst_QQuickFramebufferObject::tst_QQuickFramebufferObject()
+ : QQmlDataTest(QT_QMLTEST_DATADIR)
+{
+}
+
void tst_QQuickFramebufferObject::initTestCase()
{
QQmlDataTest::initTestCase();
@@ -202,6 +185,10 @@ void tst_QQuickFramebufferObject::testThatStuffWorks()
view.requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(&view));
+ if (QGuiApplication::platformName() == "offscreen" &&
+ view.rendererInterface()->graphicsApi() == QSGRendererInterface::Software)
+ QSKIP("offscreen software rendering doesn't work with FBOs");
+
QImage result = view.grabWindow();
QCOMPARE(frameInfo.renderCount, 1);
@@ -242,6 +229,10 @@ void tst_QQuickFramebufferObject::testInvalidate()
view.requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(&view));
+ if (QGuiApplication::platformName() == "offscreen" &&
+ view.rendererInterface()->graphicsApi() == QSGRendererInterface::Software)
+ QSKIP("offscreen software rendering doesn't work with FBOs");
+
QCOMPARE(frameInfo.fboSize, QSize(200, 200));
frameInfo.createFBOCount = 0;