summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Nurmenniemi <sami.nurmenniemi@qt.io>2017-06-19 13:31:05 +0300
committerSami Nurmenniemi <sami.nurmenniemi@qt.io>2017-08-11 08:34:35 +0000
commitd8c81e5db3e5aefd87f3f4e552eb791d84ad3d3d (patch)
tree27e28b5e839ab337644a161910e3fc9ad80c42b7
parent7cdbd6c86e36223189e7a73db80ac0979101a7f0 (diff)
Enable tests for boot2qt
The tests for boot2qt were disabled with commit 0340120d5f7940c9aebfd0f60328805227f8824d. Some of them can now be enabled since qtdeclarative fallbacks to software renderer if OpenGL is not supported. Some tests still need to be skipped if OpenGL is not supported. Task-number: QTBUG-60268 Change-Id: I8019859bc88497e08599d0b5f4981b9a3ac071f3 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--tests/auto/auto.pro2
-rw-r--r--tests/auto/cpptest/common/cpptestutil.h49
-rw-r--r--tests/auto/cpptest/common/cpptestutil.pri2
-rw-r--r--tests/auto/cpptest/cpptest.pro11
-rw-r--r--tests/auto/cpptest/q3dbars-modelproxy/q3dbars-modelproxy.pro1
-rw-r--r--tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp5
-rw-r--r--tests/auto/cpptest/q3dbars/q3dbars.pro2
-rw-r--r--tests/auto/cpptest/q3dbars/tst_bars.cpp4
-rw-r--r--tests/auto/cpptest/q3dcustom-label/q3dcustom-label.pro1
-rw-r--r--tests/auto/cpptest/q3dcustom-label/tst_custom.cpp4
-rw-r--r--tests/auto/cpptest/q3dscatter/q3dscatter.pro1
-rw-r--r--tests/auto/cpptest/q3dscatter/tst_scatter.cpp4
-rw-r--r--tests/auto/cpptest/q3dscene/q3dscene.pro1
-rw-r--r--tests/auto/cpptest/q3dscene/tst_scene.cpp5
-rw-r--r--tests/auto/cpptest/q3dsurface-modelproxy/q3dsurface-modelproxy.pro1
-rw-r--r--tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp5
-rw-r--r--tests/auto/cpptest/q3dsurface/q3dsurface.pro1
-rw-r--r--tests/auto/cpptest/q3dsurface/tst_surface.cpp4
18 files changed, 91 insertions, 12 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index ec2dc3ba..38f40591 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -6,5 +6,5 @@ qtHaveModule(quick): SUBDIRS += qmltest
installed_cmake.depends = cmake
-# QTBUG-60268
+# OpenGL support is needed for all qmltests but it's not available on boot2qt
boot2qt: SUBDIRS -= qmltest
diff --git a/tests/auto/cpptest/common/cpptestutil.h b/tests/auto/cpptest/common/cpptestutil.h
new file mode 100644
index 00000000..986ba8b9
--- /dev/null
+++ b/tests/auto/cpptest/common/cpptestutil.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Data Visualization 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$
+**
+****************************************************************************/
+
+#ifndef CPPTESTUTIL_H
+#define CPPTESTUTIL_H
+
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/qpa/qplatformintegration.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace CpptestUtil {
+
+static bool isOpenGLSupported()
+{
+ return QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL);
+}
+
+} // CpptestUtil namespace
+
+QT_END_NAMESPACE
+
+#endif
+
diff --git a/tests/auto/cpptest/common/cpptestutil.pri b/tests/auto/cpptest/common/cpptestutil.pri
new file mode 100644
index 00000000..0bac2856
--- /dev/null
+++ b/tests/auto/cpptest/common/cpptestutil.pri
@@ -0,0 +1,2 @@
+QT += gui-private
+INCLUDEPATH += $$PWD/
diff --git a/tests/auto/cpptest/cpptest.pro b/tests/auto/cpptest/cpptest.pro
index ac91d813..abd8f38e 100644
--- a/tests/auto/cpptest/cpptest.pro
+++ b/tests/auto/cpptest/cpptest.pro
@@ -24,14 +24,3 @@ SUBDIRS = q3dbars \
q3dcustom \
q3dcustom-label \
q3dcustom-volume
-
-# QTBUG-60268
-boot2qt {
- SUBDIRS -= q3dbars \
- q3dcustom-label \
- q3dsurface-modelproxy \
- q3dbars-modelproxy \
- q3dscene \
- q3dscatter \
- q3dsurface
-}
diff --git a/tests/auto/cpptest/q3dbars-modelproxy/q3dbars-modelproxy.pro b/tests/auto/cpptest/q3dbars-modelproxy/q3dbars-modelproxy.pro
index c383ec25..ad1fe0cc 100644
--- a/tests/auto/cpptest/q3dbars-modelproxy/q3dbars-modelproxy.pro
+++ b/tests/auto/cpptest/q3dbars-modelproxy/q3dbars-modelproxy.pro
@@ -1,3 +1,4 @@
+include(../common/cpptestutil.pri)
QT += testlib datavisualization widgets
TARGET = tst_cpptest
diff --git a/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp
index 2de9380d..dfeee506 100644
--- a/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp
@@ -33,6 +33,8 @@
#include <QtDataVisualization/Q3DBars>
#include <QtWidgets/QTableWidget>
+#include "cpptestutil.h"
+
using namespace QtDataVisualization;
class tst_proxy: public QObject
@@ -220,6 +222,9 @@ void tst_proxy::initializeProperties()
void tst_proxy::multiMatch()
{
+ if (!CpptestUtil::isOpenGLSupported())
+ QSKIP("OpenGL not supported on this platform");
+
Q3DBars graph;
QTableWidget table;
diff --git a/tests/auto/cpptest/q3dbars/q3dbars.pro b/tests/auto/cpptest/q3dbars/q3dbars.pro
index a7f7c809..bba500fa 100644
--- a/tests/auto/cpptest/q3dbars/q3dbars.pro
+++ b/tests/auto/cpptest/q3dbars/q3dbars.pro
@@ -1,3 +1,5 @@
+include(../common/cpptestutil.pri)
+
QT += testlib datavisualization
TARGET = tst_cpptest
diff --git a/tests/auto/cpptest/q3dbars/tst_bars.cpp b/tests/auto/cpptest/q3dbars/tst_bars.cpp
index 952682b9..0d128c36 100644
--- a/tests/auto/cpptest/q3dbars/tst_bars.cpp
+++ b/tests/auto/cpptest/q3dbars/tst_bars.cpp
@@ -34,6 +34,8 @@
#include <QtDataVisualization/Q3DInputHandler>
#include <QtDataVisualization/QTouch3DInputHandler>
+#include "cpptestutil.h"
+
using namespace QtDataVisualization;
class tst_bars: public QObject
@@ -85,6 +87,8 @@ QBar3DSeries *newSeries()
void tst_bars::initTestCase()
{
+ if (!CpptestUtil::isOpenGLSupported())
+ QSKIP("OpenGL not supported on this platform");
}
void tst_bars::cleanupTestCase()
diff --git a/tests/auto/cpptest/q3dcustom-label/q3dcustom-label.pro b/tests/auto/cpptest/q3dcustom-label/q3dcustom-label.pro
index af584baa..c47e018a 100644
--- a/tests/auto/cpptest/q3dcustom-label/q3dcustom-label.pro
+++ b/tests/auto/cpptest/q3dcustom-label/q3dcustom-label.pro
@@ -1,3 +1,4 @@
+include(../common/cpptestutil.pri)
QT += testlib datavisualization
TARGET = tst_cpptest
diff --git a/tests/auto/cpptest/q3dcustom-label/tst_custom.cpp b/tests/auto/cpptest/q3dcustom-label/tst_custom.cpp
index 1c45c908..44c9d2b2 100644
--- a/tests/auto/cpptest/q3dcustom-label/tst_custom.cpp
+++ b/tests/auto/cpptest/q3dcustom-label/tst_custom.cpp
@@ -31,6 +31,8 @@
#include <QtDataVisualization/QCustom3DLabel>
+#include "cpptestutil.h"
+
using namespace QtDataVisualization;
class tst_custom: public QObject
@@ -55,6 +57,8 @@ private:
void tst_custom::initTestCase()
{
+ if (!CpptestUtil::isOpenGLSupported())
+ QSKIP("OpenGL not supported on this platform");
}
void tst_custom::cleanupTestCase()
diff --git a/tests/auto/cpptest/q3dscatter/q3dscatter.pro b/tests/auto/cpptest/q3dscatter/q3dscatter.pro
index 9f356ebc..6c94fe64 100644
--- a/tests/auto/cpptest/q3dscatter/q3dscatter.pro
+++ b/tests/auto/cpptest/q3dscatter/q3dscatter.pro
@@ -1,3 +1,4 @@
+include(../common/cpptestutil.pri)
QT += testlib datavisualization
TARGET = tst_cpptest
diff --git a/tests/auto/cpptest/q3dscatter/tst_scatter.cpp b/tests/auto/cpptest/q3dscatter/tst_scatter.cpp
index 016985ea..64561340 100644
--- a/tests/auto/cpptest/q3dscatter/tst_scatter.cpp
+++ b/tests/auto/cpptest/q3dscatter/tst_scatter.cpp
@@ -31,6 +31,8 @@
#include <QtDataVisualization/Q3DScatter>
+#include "cpptestutil.h"
+
using namespace QtDataVisualization;
class tst_scatter: public QObject
@@ -70,6 +72,8 @@ QScatter3DSeries *newSeries()
void tst_scatter::initTestCase()
{
+ if (!CpptestUtil::isOpenGLSupported())
+ QSKIP("OpenGL not supported on this platform");
}
void tst_scatter::cleanupTestCase()
diff --git a/tests/auto/cpptest/q3dscene/q3dscene.pro b/tests/auto/cpptest/q3dscene/q3dscene.pro
index b9be69c0..b7a0110c 100644
--- a/tests/auto/cpptest/q3dscene/q3dscene.pro
+++ b/tests/auto/cpptest/q3dscene/q3dscene.pro
@@ -1,3 +1,4 @@
+include(../common/cpptestutil.pri)
QT += testlib datavisualization
TARGET = tst_cpptest
diff --git a/tests/auto/cpptest/q3dscene/tst_scene.cpp b/tests/auto/cpptest/q3dscene/tst_scene.cpp
index 1336f400..2b450f64 100644
--- a/tests/auto/cpptest/q3dscene/tst_scene.cpp
+++ b/tests/auto/cpptest/q3dscene/tst_scene.cpp
@@ -32,6 +32,8 @@
#include <QtDataVisualization/Q3DScene>
#include <QtDataVisualization/Q3DBars>
+#include "cpptestutil.h"
+
using namespace QtDataVisualization;
class tst_scene: public QObject
@@ -142,6 +144,9 @@ void tst_scene::invalidProperties()
void tst_scene::subViews()
{
+ if (!CpptestUtil::isOpenGLSupported())
+ QSKIP("OpenGL not supported on this platform");
+
Q3DBars graph;
graph.setPosition(QPoint(0, 0));
graph.setWidth(200);
diff --git a/tests/auto/cpptest/q3dsurface-modelproxy/q3dsurface-modelproxy.pro b/tests/auto/cpptest/q3dsurface-modelproxy/q3dsurface-modelproxy.pro
index c383ec25..ad1fe0cc 100644
--- a/tests/auto/cpptest/q3dsurface-modelproxy/q3dsurface-modelproxy.pro
+++ b/tests/auto/cpptest/q3dsurface-modelproxy/q3dsurface-modelproxy.pro
@@ -1,3 +1,4 @@
+include(../common/cpptestutil.pri)
QT += testlib datavisualization widgets
TARGET = tst_cpptest
diff --git a/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp
index 9bea4ae0..eb984c1a 100644
--- a/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp
@@ -33,6 +33,8 @@
#include <QtDataVisualization/Q3DSurface>
#include <QtWidgets/QTableWidget>
+#include "cpptestutil.h"
+
using namespace QtDataVisualization;
class tst_proxy: public QObject
@@ -234,6 +236,9 @@ void tst_proxy::initializeProperties()
void tst_proxy::multiMatch()
{
+ if (!CpptestUtil::isOpenGLSupported())
+ QSKIP("OpenGL not supported on this platform");
+
Q3DSurface graph;
QTableWidget table;
diff --git a/tests/auto/cpptest/q3dsurface/q3dsurface.pro b/tests/auto/cpptest/q3dsurface/q3dsurface.pro
index b7a6bf08..9ed3c7f5 100644
--- a/tests/auto/cpptest/q3dsurface/q3dsurface.pro
+++ b/tests/auto/cpptest/q3dsurface/q3dsurface.pro
@@ -1,3 +1,4 @@
+include(../common/cpptestutil.pri)
QT += testlib datavisualization
TARGET = tst_cpptest
diff --git a/tests/auto/cpptest/q3dsurface/tst_surface.cpp b/tests/auto/cpptest/q3dsurface/tst_surface.cpp
index 676f785e..04fe5d21 100644
--- a/tests/auto/cpptest/q3dsurface/tst_surface.cpp
+++ b/tests/auto/cpptest/q3dsurface/tst_surface.cpp
@@ -31,6 +31,8 @@
#include <QtDataVisualization/Q3DSurface>
+#include "cpptestutil.h"
+
using namespace QtDataVisualization;
class tst_surface: public QObject
@@ -75,6 +77,8 @@ QSurface3DSeries *newSeries()
void tst_surface::initTestCase()
{
+ if (!CpptestUtil::isOpenGLSupported())
+ QSKIP("OpenGL not supported on this platform");
}
void tst_surface::cleanupTestCase()