diff options
Diffstat (limited to 'tests/auto/quick')
-rw-r--r-- | tests/auto/quick/qquickgraphicsinfo/data/basic.qml | 14 | ||||
-rw-r--r-- | tests/auto/quick/qquickgraphicsinfo/qquickgraphicsinfo.pro (renamed from tests/auto/quick/qquickrendererinfo/qquickrendererinfo.pro) | 4 | ||||
-rw-r--r-- | tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp (renamed from tests/auto/quick/qquickrendererinfo/tst_qquickrendererinfo.cpp) | 25 | ||||
-rw-r--r-- | tests/auto/quick/qquickrendererinfo/data/basic.qml | 5 | ||||
-rw-r--r-- | tests/auto/quick/quick.pro | 2 |
5 files changed, 38 insertions, 12 deletions
diff --git a/tests/auto/quick/qquickgraphicsinfo/data/basic.qml b/tests/auto/quick/qquickgraphicsinfo/data/basic.qml new file mode 100644 index 0000000000..6ff3b82cec --- /dev/null +++ b/tests/auto/quick/qquickgraphicsinfo/data/basic.qml @@ -0,0 +1,14 @@ +import QtQuick 2.8 + +Item { + property int api: GraphicsInfo.api + + property int shaderType: GraphicsInfo.shaderType + property int shaderCompilationType: GraphicsInfo.shaderCompilationType + property int shaderSourceType: GraphicsInfo.shaderSourceType + + property int majorVersion: GraphicsInfo.majorVersion + property int minorVersion: GraphicsInfo.minorVersion + property int profile: GraphicsInfo.profile + property int renderableType: GraphicsInfo.renderableType +} diff --git a/tests/auto/quick/qquickrendererinfo/qquickrendererinfo.pro b/tests/auto/quick/qquickgraphicsinfo/qquickgraphicsinfo.pro index 4f55b79961..a4296ad9a2 100644 --- a/tests/auto/quick/qquickrendererinfo/qquickrendererinfo.pro +++ b/tests/auto/quick/qquickgraphicsinfo/qquickgraphicsinfo.pro @@ -1,6 +1,6 @@ CONFIG += testcase -TARGET = tst_qquickrendererinfo -SOURCES += tst_qquickrendererinfo.cpp +TARGET = tst_qquickgraphicsinfo +SOURCES += tst_qquickgraphicsinfo.cpp TESTDATA = data/* include(../../shared/util.pri) diff --git a/tests/auto/quick/qquickrendererinfo/tst_qquickrendererinfo.cpp b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp index 5e2da76333..256fa43d2e 100644 --- a/tests/auto/quick/qquickrendererinfo/tst_qquickrendererinfo.cpp +++ b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp @@ -35,7 +35,12 @@ #include "../../shared/util.h" -class tst_QQuickRendererInfo : public QQmlDataTest +#ifndef QT_NO_OPENGL +#include <QtGui/qopenglcontext.h> +#include <QtGui/qsurfaceformat.h> +#endif + +class tst_QQuickGraphicsInfo : public QQmlDataTest { Q_OBJECT @@ -43,7 +48,7 @@ private slots: void testProperties(); }; -void tst_QQuickRendererInfo::testProperties() +void tst_QQuickGraphicsInfo::testProperties() { QQuickView view; view.setSource(QUrl::fromLocalFile("data/basic.qml")); @@ -61,8 +66,20 @@ void tst_QQuickRendererInfo::testProperties() const int expectedAPI = rif ? rif->graphicsApi() : QSGRendererInterface::Unknown; QCOMPARE(obj->property("api").toInt(), expectedAPI); + +#ifndef QT_NO_OPENGL + if (expectedAPI == QSGRendererInterface::OpenGL) { + QCOMPARE(obj->property("shaderType").toInt(), int(QSGRendererInterface::GLSL)); + QVERIFY(view.openglContext()); + QSurfaceFormat format = view.openglContext()->format(); + QCOMPARE(obj->property("majorVersion").toInt(), format.majorVersion()); + QCOMPARE(obj->property("minorVersion").toInt(), format.minorVersion()); + QCOMPARE(obj->property("profile").toInt(), static_cast<int>(format.profile())); + QCOMPARE(obj->property("renderableType").toInt(), static_cast<int>(format.renderableType())); + } +#endif } -QTEST_MAIN(tst_QQuickRendererInfo) +QTEST_MAIN(tst_QQuickGraphicsInfo) -#include "tst_qquickrendererinfo.moc" +#include "tst_qquickgraphicsinfo.moc" diff --git a/tests/auto/quick/qquickrendererinfo/data/basic.qml b/tests/auto/quick/qquickrendererinfo/data/basic.qml deleted file mode 100644 index b7dbbb9ac9..0000000000 --- a/tests/auto/quick/qquickrendererinfo/data/basic.qml +++ /dev/null @@ -1,5 +0,0 @@ -import QtQuick 2.8 - -Item { - property int api: RendererInfo.api -} diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index fecd1aea58..70e5b8ef6a 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -57,6 +57,7 @@ QUICKTESTS = \ qquickflickable \ qquickflipable \ qquickfocusscope \ + qquickgraphicsinfo \ qquickgridview \ qquickimage \ qquickitem \ @@ -71,7 +72,6 @@ QUICKTESTS = \ qquickpincharea \ qquickpositioners \ qquickrectangle \ - qquickrendererinfo \ qquickrepeater \ qquickshortcut \ qquicktext \ |