From d8d3259b2340baed2e7f8273907bd0bb5598b540 Mon Sep 17 00:00:00 2001 From: Sami Nurmenniemi Date: Wed, 30 Aug 2017 15:39:28 +0300 Subject: Enable tests for boot2qt Some tests needed fixing - Disabled tests too heavy for qemu - Skipped tests requiring OpenGL without support from the platform - Skipped tests requiring functionality on broken offscreen platform - Skipped tests that take too long on qemu + software renderer - Blacklisted tests for created bugs QTBUG-63049, QTBUG-63053 QTBUG-63055 and QTBUG-63057 Task-number: QTBUG-60268 Change-Id: I0346b0e436cf286d7d9cbc140acf324a4087cfb9 Reviewed-by: Simon Hausmann --- tests/auto/auto.pro | 3 - tests/auto/particles/qquickimageparticle/BLACKLIST | 16 ++++ tests/auto/particles/qquickspritegoal/BLACKLIST | 3 + .../tst_qqmlprofilerservice.cpp | 19 +++-- tests/auto/qml/qml.pro | 10 +-- tests/auto/qml/qmlmin/qmlmin.pro | 6 +- tests/auto/qml/qqmlengine/qqmlengine.pro | 5 ++ tests/auto/qml/qqmlengine/tst_qqmlengine.cpp | 4 + tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml | 8 ++ .../shadersource/tst_DynamicallyCreatedSource.qml | 4 + tests/auto/quick/drawingmodes/tst_drawingmodes.cpp | 34 ++++++++ tests/auto/quick/nodes/tst_nodestest.cpp | 6 ++ .../quick/qquickcanvasitem/data/tst_imagedata.qml | 4 + tests/auto/quick/qquickimage/tst_qquickimage.cpp | 12 +++ tests/auto/quick/qquickitem2/tst_qquickitem.cpp | 4 + .../quick/qquickitemlayer/tst_qquickitemlayer.cpp | 79 ++++++++++++------ tests/auto/quick/qquickloader/BLACKLIST | 4 + .../quick/qquickmousearea/tst_qquickmousearea.cpp | 4 + tests/auto/quick/qquickpainteditem/BLACKLIST | 27 ++++++ .../quick/qquickrectangle/tst_qquickrectangle.cpp | 4 + tests/auto/quick/qquickshape/tst_qquickshape.cpp | 16 ++++ tests/auto/quick/qquicktext/tst_qquicktext.cpp | 4 + .../quick/qquicktextedit/tst_qquicktextedit.cpp | 4 + tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 7 ++ tests/auto/quick/quick.pro | 3 + tests/auto/quick/rendernode/tst_rendernode.cpp | 14 ++++ tests/auto/quick/scenegraph/tst_scenegraph.cpp | 97 +++++++++++++--------- .../quickwidgets/qquickwidget/tst_qquickwidget.cpp | 4 + 28 files changed, 320 insertions(+), 85 deletions(-) create mode 100644 tests/auto/particles/qquickimageparticle/BLACKLIST create mode 100644 tests/auto/particles/qquickspritegoal/BLACKLIST create mode 100644 tests/auto/quick/qquickloader/BLACKLIST create mode 100644 tests/auto/quick/qquickpainteditem/BLACKLIST diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index f9c1fcce91..1e80f1bf65 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -18,7 +18,4 @@ qtHaveModule(gui):qtConfig(opengl(es1|es2)?) { # console applications not supported uikit: SUBDIRS -= qmltest -# Restricted sub-set for now -boot2qt: SUBDIRS = qml - installed_cmake.depends = cmake diff --git a/tests/auto/particles/qquickimageparticle/BLACKLIST b/tests/auto/particles/qquickimageparticle/BLACKLIST new file mode 100644 index 0000000000..a615dcd6e6 --- /dev/null +++ b/tests/auto/particles/qquickimageparticle/BLACKLIST @@ -0,0 +1,16 @@ +# QTBUG-63055 +[test_colored] +b2qt + +# QTBUG-63055 +[test_colorVariance] +b2qt + +# QTBUG-63055 +[test_deformed] +b2qt + +# QTBUG-63055 +[test_sprite] +b2qt + diff --git a/tests/auto/particles/qquickspritegoal/BLACKLIST b/tests/auto/particles/qquickspritegoal/BLACKLIST new file mode 100644 index 0000000000..bd64621f77 --- /dev/null +++ b/tests/auto/particles/qquickspritegoal/BLACKLIST @@ -0,0 +1,3 @@ +# QTBUG-63057 +[test_instantTransition] +b2qt diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 6232a8a867..cc6083cb98 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -36,6 +36,9 @@ #include #include +#include +#include + struct QQmlProfilerData { QQmlProfilerData(qint64 time = -2, int messageType = -1, int detailType = -1, @@ -584,16 +587,18 @@ void tst_QQmlProfilerService::scenegraphData() qint64 contextFrameTime = -1; qint64 renderFrameTime = -1; #if QT_CONFIG(opengl) //Software renderer doesn't have context frames - foreach (const QQmlProfilerData &msg, m_client->asynchronousMessages) { - if (msg.messageType == QQmlProfilerDefinitions::SceneGraphFrame) { - if (msg.detailType == QQmlProfilerDefinitions::SceneGraphContextFrame) { - contextFrameTime = msg.time; - break; + if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) { + foreach (const QQmlProfilerData &msg, m_client->asynchronousMessages) { + if (msg.messageType == QQmlProfilerDefinitions::SceneGraphFrame) { + if (msg.detailType == QQmlProfilerDefinitions::SceneGraphContextFrame) { + contextFrameTime = msg.time; + break; + } } } - } - QVERIFY(contextFrameTime != -1); + QVERIFY(contextFrameTime != -1); + } #endif foreach (const QQmlProfilerData &msg, m_client->asynchronousMessages) { if (msg.detailType == QQmlProfilerDefinitions::SceneGraphRendererFrame) { diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro index 69af3cd13b..9155f5b021 100644 --- a/tests/auto/qml/qml.pro +++ b/tests/auto/qml/qml.pro @@ -9,7 +9,6 @@ PUBLICTESTS += \ qjsonbinding \ qqmlfile \ -!boot2qt { PUBLICTESTS += \ qmlmin \ qqmlcomponent \ @@ -31,7 +30,6 @@ PUBLICTESTS += \ qqmlsettings \ qqmlstatemachine \ qmldiskcache -} PRIVATETESTS += \ qqmlcpputils \ @@ -39,7 +37,6 @@ PRIVATETESTS += \ v4misc \ qmlcachegen -!boot2qt { PRIVATETESTS += \ animation \ qqmlecmascript \ @@ -74,7 +71,6 @@ PRIVATETESTS += \ qv4mm \ ecmascripttests \ bindingdependencyapi -} qtHaveModule(widgets) { PUBLICTESTS += \ @@ -84,9 +80,11 @@ qtHaveModule(widgets) { SUBDIRS += $$PUBLICTESTS SUBDIRS += $$METATYPETESTS -qtConfig(process):!boot2qt { +qtConfig(process) { !contains(QT_CONFIG, no-qml-debug): SUBDIRS += debugger - SUBDIRS += qmllint qmlplugindump + !boot2qt { + SUBDIRS += qmllint qmlplugindump + } } qtConfig(library) { diff --git a/tests/auto/qml/qmlmin/qmlmin.pro b/tests/auto/qml/qmlmin/qmlmin.pro index 6af6653270..93e5caabcf 100644 --- a/tests/auto/qml/qmlmin/qmlmin.pro +++ b/tests/auto/qml/qmlmin/qmlmin.pro @@ -6,5 +6,7 @@ macx:CONFIG -= app_bundle SOURCES += tst_qmlmin.cpp DEFINES += SRCDIR=\\\"$$PWD\\\" - -cross_compile: DEFINES += QTEST_CROSS_COMPILED +# Boot2qt is cross compiled but it has sources available +!boot2qt { + cross_compile: DEFINES += QTEST_CROSS_COMPILED +} diff --git a/tests/auto/qml/qqmlengine/qqmlengine.pro b/tests/auto/qml/qqmlengine/qqmlengine.pro index e7952d8e3a..8d1e149d62 100644 --- a/tests/auto/qml/qqmlengine/qqmlengine.pro +++ b/tests/auto/qml/qqmlengine/qqmlengine.pro @@ -7,3 +7,8 @@ include (../../shared/util.pri) SOURCES += tst_qqmlengine.cpp QT += core-private gui-private qml-private network testlib + +boot2qt: { + # GC corruption test is too heavy for qemu-arm + DEFINES += SKIP_GCCORRUPTION_TEST +} diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index 7aca830297..b332ab2194 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -862,6 +862,10 @@ void tst_qqmlengine::qmlContextProperties() void tst_qqmlengine::testGCCorruption() { +#ifdef SKIP_GCCORRUPTION_TEST + QSKIP("Test too heavy for qemu"); +#endif + QQmlEngine e; QQmlComponent c(&e, testFileUrl("testGCCorruption.qml")); diff --git a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml index 53ed3658c2..af1b4db0e0 100644 --- a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml +++ b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml @@ -40,6 +40,10 @@ Item { when: imageOnDisk.ready && imageOnDiskSmall.ready function test_endresult_disk() { + if ((Qt.platform.pluginName === "offscreen") + || (Qt.platform.pluginName === "minimal")) + skip("grabImage does not work on offscreen/minimal platforms"); + var image = grabImage(root); // imageOnDisk at (0, 0) - (100x100) @@ -73,6 +77,10 @@ Item { } function test_endresult_cache(data) { + if ((Qt.platform.pluginName === "offscreen") + || (Qt.platform.pluginName === "minimal")) + skip("grabImage does not work on offscreen/minimal platforms"); + imageInCache.cache = data.cache; imageInCache.sourceSize = data.sourceSize; imageInCache.fillMode = data.fillMode; diff --git a/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml b/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml index 2c6d4cc28f..74dc63a972 100644 --- a/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml +++ b/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml @@ -67,6 +67,10 @@ Item { when: root.source != undefined function test_endresult() { + if ((Qt.platform.pluginName === "offscreen") + || (Qt.platform.pluginName === "minimal")) + skip("grabImage does not work on offscreen/minimal platforms"); + var image = grabImage(root); compare(image.red(0,0), 255); compare(image.green(0,0), 0); diff --git a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp index d4065e3d38..fe794cf952 100644 --- a/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp +++ b/tests/auto/quick/drawingmodes/tst_drawingmodes.cpp @@ -149,6 +149,10 @@ void tst_drawingmodes::points() if (QGuiApplication::primaryScreen()->depth() < 24) QSKIP("This test does not work at display depths < 24"); + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + #ifdef Q_OS_WIN if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) QSKIP("ANGLE cannot draw GL_POINTS."); @@ -187,6 +191,11 @@ void tst_drawingmodes::lines() DrawingModeItem::drawingMode = GL_LINES; if (QGuiApplication::primaryScreen()->depth() < 24) QSKIP("This test does not work at display depths < 24"); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("DrawingModes.qml"); QCOMPARE(fb.width(), 200); @@ -213,6 +222,11 @@ void tst_drawingmodes::lineStrip() DrawingModeItem::drawingMode = GL_LINE_STRIP; if (QGuiApplication::primaryScreen()->depth() < 24) QSKIP("This test does not work at display depths < 24"); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("DrawingModes.qml"); QCOMPARE(fb.width(), 200); @@ -241,6 +255,11 @@ void tst_drawingmodes::lineLoop() DrawingModeItem::drawingMode = GL_LINE_LOOP; if (QGuiApplication::primaryScreen()->depth() < 24) QSKIP("This test does not work at display depths < 24"); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("DrawingModes.qml"); QCOMPARE(fb.width(), 200); @@ -269,6 +288,11 @@ void tst_drawingmodes::triangles() DrawingModeItem::drawingMode = GL_TRIANGLES; if (QGuiApplication::primaryScreen()->depth() < 24) QSKIP("This test does not work at display depths < 24"); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("DrawingModes.qml"); QCOMPARE(fb.width(), 200); @@ -293,6 +317,11 @@ void tst_drawingmodes::triangleStrip() DrawingModeItem::drawingMode = GL_TRIANGLE_STRIP; if (QGuiApplication::primaryScreen()->depth() < 24) QSKIP("This test does not work at display depths < 24"); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("DrawingModes.qml"); QCOMPARE(fb.width(), 200); @@ -316,6 +345,11 @@ void tst_drawingmodes::triangleFan() DrawingModeItem::drawingMode = GL_TRIANGLE_FAN; if (QGuiApplication::primaryScreen()->depth() < 24) QSKIP("This test does not work at display depths < 24"); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("DrawingModes.qml"); QCOMPARE(fb.width(), 200); diff --git a/tests/auto/quick/nodes/tst_nodestest.cpp b/tests/auto/quick/nodes/tst_nodestest.cpp index 63e0aeb324..140a3b583e 100644 --- a/tests/auto/quick/nodes/tst_nodestest.cpp +++ b/tests/auto/quick/nodes/tst_nodestest.cpp @@ -41,6 +41,9 @@ #include #include +#include +#include + QT_BEGIN_NAMESPACE inline bool operator==(const QSGGeometry::TexturedPoint2D& l, const QSGGeometry::TexturedPoint2D& r) { @@ -80,6 +83,9 @@ private: void NodesTest::initTestCase() { + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) + QSKIP("OpenGL not supported by the platform"); + QSGRenderLoop *renderLoop = QSGRenderLoop::instance(); surface = new QOffscreenSurface; diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_imagedata.qml b/tests/auto/quick/qquickcanvasitem/data/tst_imagedata.qml index 7095602ea2..76b99a765e 100644 --- a/tests/auto/quick/qquickcanvasitem/data/tst_imagedata.qml +++ b/tests/auto/quick/qquickcanvasitem/data/tst_imagedata.qml @@ -6,6 +6,10 @@ CanvasTestCase { name: "imagedata" function init_data() { return testData("2d"); } function test_rounding(row) { + if ((Qt.platform.pluginName === "offscreen") + || (Qt.platform.pluginName === "minimal")) + skip("ctx.getImageData crashes on offscreen/minimal platforms"); + var canvas = createCanvasObject(row); var ctx = canvas.getContext('2d'); var size = 17 diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp index a2a65aa803..256e667980 100644 --- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp +++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp @@ -301,6 +301,10 @@ void tst_qquickimage::smooth() void tst_qquickimage::mirror() { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QMap screenshots; QList fillModes; fillModes << QQuickImage::Stretch << QQuickImage::PreserveAspectFit << QQuickImage::PreserveAspectCrop @@ -501,6 +505,10 @@ void tst_qquickimage::big() void tst_qquickimage::tiling_QTBUG_6716() { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QFETCH(QString, source); QQuickView view(testFileUrl(source)); @@ -1034,6 +1042,10 @@ void tst_qquickimage::highDpiFillModesAndSizes() void tst_qquickimage::hugeImages() { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QQuickView view; view.setSource(testFileUrl("hugeImages.qml")); view.setGeometry(0, 0, 200, 200); diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp index 09e89ff85f..00aa5ef726 100644 --- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp +++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp @@ -3305,6 +3305,10 @@ void tst_QQuickItem::childAt() void tst_QQuickItem::grab() { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabToImage not functional on offscreen/minimimal platforms"); + QQuickView view; view.setSource(testFileUrl("grabToImage.qml")); view.show(); diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp index 5419778cfc..e52370721f 100644 --- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp +++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp @@ -36,6 +36,9 @@ #include "../../shared/util.h" +#include +#include + class tst_QQuickItemLayer: public QQmlDataTest { Q_OBJECT @@ -102,35 +105,37 @@ void tst_QQuickItemLayer::initTestCase() { QQmlDataTest::initTestCase(); #if QT_CONFIG(opengl) - QWindow window; - QOpenGLContext context; - window.setSurfaceType(QWindow::OpenGLSurface); - window.create(); - QVERIFY(context.create()); - QVERIFY(context.makeCurrent(&window)); - const char *vendor = (const char *)context.functions()->glGetString(GL_VENDOR); - const char *renderer = (const char *)context.functions()->glGetString(GL_RENDERER); - m_isMesaSoftwareRasterizer = strcmp(vendor, "Mesa Project") == 0 - && strcmp(renderer, "Software Rasterizer") == 0; - if (m_isMesaSoftwareRasterizer) { - // Expects format: Mesa [-devel] [...] - const char *version = (const char *)context.functions()->glGetString(GL_VERSION); - QList list = QByteArray(version).split(' '); - if (list.size() >= 3) { - list = list.at(2).split('-').at(0).split('.'); - int major = 0; - int minor = 0; - int patch = 0; - if (list.size() >= 1) - major = list.at(0).toInt(); - if (list.size() >= 2) - minor = list.at(1).toInt(); - if (list.size() >= 3) - patch = list.at(2).toInt(); - m_mesaVersion = QT_VERSION_CHECK(major, minor, patch); + if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) { + QWindow window; + QOpenGLContext context; + window.setSurfaceType(QWindow::OpenGLSurface); + window.create(); + QVERIFY(context.create()); + QVERIFY(context.makeCurrent(&window)); + const char *vendor = (const char *)context.functions()->glGetString(GL_VENDOR); + const char *renderer = (const char *)context.functions()->glGetString(GL_RENDERER); + m_isMesaSoftwareRasterizer = strcmp(vendor, "Mesa Project") == 0 + && strcmp(renderer, "Software Rasterizer") == 0; + if (m_isMesaSoftwareRasterizer) { + // Expects format: Mesa [-devel] [...] + const char *version = (const char *)context.functions()->glGetString(GL_VERSION); + QList list = QByteArray(version).split(' '); + if (list.size() >= 3) { + list = list.at(2).split('-').at(0).split('.'); + int major = 0; + int minor = 0; + int patch = 0; + if (list.size() >= 1) + major = list.at(0).toInt(); + if (list.size() >= 2) + minor = list.at(1).toInt(); + if (list.size() >= 3) + patch = list.at(2).toInt(); + m_mesaVersion = QT_VERSION_CHECK(major, minor, patch); + } } + window.create(); } - window.create(); #endif QQuickView view; view.showNormal(); @@ -147,6 +152,11 @@ void tst_QQuickItemLayer::layerSmooth() { if (m_isMesaSoftwareRasterizer && m_mesaVersion < QT_VERSION_CHECK(7, 11, 0)) QSKIP("Mesa Software Rasterizer below version 7.11 does not render this test correctly."); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("Smooth.qml"); QCOMPARE(fb.pixel(0, 0), qRgb(0xff, 0, 0)); QCOMPARE(fb.pixel(fb.width() - 1, 0), qRgb(0, 0, 0xff)); @@ -166,6 +176,11 @@ void tst_QQuickItemLayer::layerEnabled() { if (m_isMesaSoftwareRasterizer && m_mesaVersion < QT_VERSION_CHECK(7, 11, 0)) QSKIP("Mesa Software Rasterizer below version 7.11 does not render this test correctly."); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("Enabled.qml"); // Verify the banding QCOMPARE(fb.pixel(0, 0), fb.pixel(0, 1)); @@ -181,6 +196,7 @@ void tst_QQuickItemLayer::layerMipmap() { if (m_isMesaSoftwareRasterizer) QSKIP("Mipmapping does not work with the Mesa Software Rasterizer."); + QImage fb = runTest("Mipmap.qml"); QVERIFY(fb.pixel(0, 0) != 0xff000000); QVERIFY(fb.pixel(0, 0) != 0xffffffff); @@ -195,6 +211,11 @@ void tst_QQuickItemLayer::layerEffect() { if (m_isMesaSoftwareRasterizer && m_mesaVersion < QT_VERSION_CHECK(7, 11, 0)) QSKIP("Mesa Software Rasterizer below version 7.11 does not render this test correctly."); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("Effect.qml"); QCOMPARE(fb.pixel(0, 0), qRgb(0xff, 0, 0)); QCOMPARE(fb.pixel(fb.width() - 1, 0), qRgb(0, 0xff, 0)); @@ -451,6 +472,10 @@ void tst_QQuickItemLayer::itemEffect() void tst_QQuickItemLayer::rectangleEffect() { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("RectangleEffect.qml"); QCOMPARE(fb.pixel(0, 0), qRgb(0, 0xff, 0)); QCOMPARE(fb.pixel(199, 0), qRgb(0, 0xff, 0)); diff --git a/tests/auto/quick/qquickloader/BLACKLIST b/tests/auto/quick/qquickloader/BLACKLIST new file mode 100644 index 0000000000..a45a300607 --- /dev/null +++ b/tests/auto/quick/qquickloader/BLACKLIST @@ -0,0 +1,4 @@ +# Test fails on qemu when bound to one core, passes on real ARM +# QTBUG-63049 +[asyncToSync1] +b2qt diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp index 01bce46ccb..05785dd3a0 100644 --- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp +++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp @@ -1293,6 +1293,10 @@ void tst_QQuickMouseArea::hoverPropagation() void tst_QQuickMouseArea::hoverVisible() { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QQuickView window; QByteArray errorMessage; QVERIFY2(initView(window, testFileUrl("hoverVisible.qml"), true, &errorMessage), errorMessage.constData()); diff --git a/tests/auto/quick/qquickpainteditem/BLACKLIST b/tests/auto/quick/qquickpainteditem/BLACKLIST new file mode 100644 index 0000000000..9b58325f6c --- /dev/null +++ b/tests/auto/quick/qquickpainteditem/BLACKLIST @@ -0,0 +1,27 @@ +# QTBUG-63053 +[opaquePainting] +b2qt + +# QTBUG-63053 +[antialiasing] +b2qt + +# QTBUG-63053 +[mipmap] +b2qt + +# QTBUG-63053 +[performanceHints] +b2qt + +# QTBUG-63053 +[contentScale] +b2qt + +# QTBUG-63053 +[contentsBoundingRect] +b2qt + +# QTBUG-63053 +[fillColor] +b2qt diff --git a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp index 0d79592e37..2aaad867bf 100644 --- a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp +++ b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp @@ -70,6 +70,10 @@ void tst_qquickrectangle::color() QVERIFY(QTest::qWaitForWindowExposed(&view)); + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QEXPECT_FAIL("", "Failure due to grabWindow not functional on offscreen/minimimal platforms", Abort); + QImage image = view.grabWindow(); QVERIFY(image.pixel(0,0) == QColor("#020202").rgba()); } diff --git a/tests/auto/quick/qquickshape/tst_qquickshape.cpp b/tests/auto/quick/qquickshape/tst_qquickshape.cpp index 1b5b345d19..2a349d2013 100644 --- a/tests/auto/quick/qquickshape/tst_qquickshape.cpp +++ b/tests/auto/quick/qquickshape/tst_qquickshape.cpp @@ -223,6 +223,10 @@ void tst_QQuickShape::render() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window.data())); + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QEXPECT_FAIL("", "Failure due to grabWindow not functional on offscreen/minimimal platforms", Abort); + QImage img = window->grabWindow(); QVERIFY(!img.isNull()); @@ -240,6 +244,10 @@ void tst_QQuickShape::renderWithMultipleSp() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window.data())); + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QEXPECT_FAIL("", "Failure due to grabWindow not functional on offscreen/minimimal platforms", Abort); + QImage img = window->grabWindow(); QVERIFY(!img.isNull()); @@ -257,6 +265,10 @@ void tst_QQuickShape::radialGrad() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window.data())); + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QEXPECT_FAIL("", "Failure due to grabWindow not functional on offscreen/minimimal platforms", Abort); + QImage img = window->grabWindow(); QVERIFY(!img.isNull()); @@ -274,6 +286,10 @@ void tst_QQuickShape::conicalGrad() window->show(); QVERIFY(QTest::qWaitForWindowExposed(window.data())); + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QEXPECT_FAIL("", "Failure due to grabWindow not functional on offscreen/minimimal platforms", Abort); + QImage img = window->grabWindow(); QVERIFY(!img.isNull()); diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index 4e643bb9d9..51c04a109d 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -984,6 +984,10 @@ void tst_qquicktext::hAlignImplicitWidth() const int centeredSection3End = centeredSection3 + sectionWidth; { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QEXPECT_FAIL("", "Failure due to grabWindow not functional on offscreen/minimimal platforms", Abort); + // Left Align QImage image = view.grabWindow(); const int left = numberOfNonWhitePixels(centeredSection1, centeredSection2, image); diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index ac57a05176..1edf0401c6 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -904,6 +904,10 @@ void tst_qquicktextedit::hAlignVisual() const int centeredSection3End = centeredSection3 + sectionWidth; { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QEXPECT_FAIL("", "Failure due to grabWindow not functional on offscreen/minimimal platforms", Abort); + // Left Align QImage image = view.grabWindow(); const int left = numberOfNonWhitePixels(centeredSection1, centeredSection2, image); diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 0c3e580828..ba04a30a87 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -1270,6 +1270,10 @@ void tst_qquickwindow::grab_data() void tst_qquickwindow::grab() { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QFETCH(bool, visible); QFETCH(bool, alpha); @@ -2349,6 +2353,9 @@ void tst_qquickwindow::testRenderJob() window.scheduleRenderJob(new RenderJob(QQuickWindow::NoStage, &completedJobs), QQuickWindow::NoStage); QTRY_COMPARE(RenderJob::deleted, 1); + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QEXPECT_FAIL("", "NoStage job fails on offscreen/minimimal platforms", Continue); QCOMPARE(completedJobs.size(), 1); #if QT_CONFIG(opengl) diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index 9b7740646a..65333e166e 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -92,6 +92,9 @@ QUICKTESTS = \ SUBDIRS += $$PUBLICTESTS +# Following tests are too slow on qemu + software backend +boot2qt: QUICKTESTS -= qquickgridview qquicklistview qquickpositioners + !qtConfig(accessibility):QUICKTESTS -= qquickaccessible qtConfig(private_tests) { diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp index e0fe2c42fc..d6e1982b1e 100644 --- a/tests/auto/quick/rendernode/tst_rendernode.cpp +++ b/tests/auto/quick/rendernode/tst_rendernode.cpp @@ -213,6 +213,11 @@ void tst_rendernode::renderOrder() { if (QGuiApplication::primaryScreen()->depth() < 24) QSKIP("This test does not work at display depths < 24"); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("RenderOrder.qml"); const qreal scaleFactor = QGuiApplication::primaryScreen()->devicePixelRatio(); @@ -237,6 +242,11 @@ void tst_rendernode::messUpState() { if (QGuiApplication::primaryScreen()->depth() < 24) QSKIP("This test does not work at display depths < 24"); + + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QImage fb = runTest("MessUpState.qml"); int x1 = 0; int x2 = fb.width() / 2; @@ -290,6 +300,10 @@ public: void tst_rendernode::matrix() { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + qmlRegisterType("RenderNode", 1, 0, "StateRecorder"); StateRecordingRenderNode::matrices.clear(); runTest("matrix.qml"); diff --git a/tests/auto/quick/scenegraph/tst_scenegraph.cpp b/tests/auto/quick/scenegraph/tst_scenegraph.cpp index 2cd3a041c8..d8d9cd26e0 100644 --- a/tests/auto/quick/scenegraph/tst_scenegraph.cpp +++ b/tests/auto/quick/scenegraph/tst_scenegraph.cpp @@ -47,6 +47,9 @@ #include "../../shared/util.h" #include "../shared/visualtestutil.h" +#include +#include + using namespace QQuickVisualTestUtil; class PerPixelRect : public QQuickItem @@ -114,6 +117,7 @@ private slots: private: bool m_brokenMipmapSupport; QQuickView *createView(const QString &file, QWindow *parent = 0, int x = -1, int y = -1, int w = -1, int h = -1); + bool isRunningOnOpenGL(); }; template class ScopedList : public QList { @@ -131,38 +135,40 @@ void tst_SceneGraph::initTestCase() qDebug() << "RenderLoop: " << loop; #if QT_CONFIG(opengl) - QOpenGLContext context; - context.setFormat(loop->sceneGraphContext()->defaultSurfaceFormat()); - context.create(); - QSurfaceFormat format = context.format(); - - QOffscreenSurface surface; - surface.setFormat(format); - surface.create(); - if (!context.makeCurrent(&surface)) - qFatal("Failed to create a GL context..."); - - QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); - qDebug() << "R/G/B/A Buffers: " << format.redBufferSize() << format.greenBufferSize() << format.blueBufferSize() << format.alphaBufferSize(); - qDebug() << "Depth Buffer: " << format.depthBufferSize(); - qDebug() << "Stencil Buffer: " << format.stencilBufferSize(); - qDebug() << "Samples: " << format.samples(); - int textureSize; - funcs->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &textureSize); - qDebug() << "Max Texture Size: " << textureSize; - qDebug() << "GL_VENDOR: " << (const char *) funcs->glGetString(GL_VENDOR); - qDebug() << "GL_RENDERER: " << (const char *) funcs->glGetString(GL_RENDERER); - QByteArray version = (const char *) funcs->glGetString(GL_VERSION); - qDebug() << "GL_VERSION: " << version.constData(); - QSet exts = context.extensions(); - QByteArray all; - foreach (const QByteArray &e, exts) all += ' ' + e; - qDebug() << "GL_EXTENSIONS: " << all.constData(); - - m_brokenMipmapSupport = version.contains("Mesa 10.1") || version.contains("Mesa 9."); - qDebug() << "Broken Mipmap: " << m_brokenMipmapSupport; - - context.doneCurrent(); + if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) { + QOpenGLContext context; + context.setFormat(loop->sceneGraphContext()->defaultSurfaceFormat()); + context.create(); + QSurfaceFormat format = context.format(); + + QOffscreenSurface surface; + surface.setFormat(format); + surface.create(); + if (!context.makeCurrent(&surface)) + qFatal("Failed to create a GL context..."); + + QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); + qDebug() << "R/G/B/A Buffers: " << format.redBufferSize() << format.greenBufferSize() << format.blueBufferSize() << format.alphaBufferSize(); + qDebug() << "Depth Buffer: " << format.depthBufferSize(); + qDebug() << "Stencil Buffer: " << format.stencilBufferSize(); + qDebug() << "Samples: " << format.samples(); + int textureSize; + funcs->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &textureSize); + qDebug() << "Max Texture Size: " << textureSize; + qDebug() << "GL_VENDOR: " << (const char *) funcs->glGetString(GL_VENDOR); + qDebug() << "GL_RENDERER: " << (const char *) funcs->glGetString(GL_RENDERER); + QByteArray version = (const char *) funcs->glGetString(GL_VERSION); + qDebug() << "GL_VERSION: " << version.constData(); + QSet exts = context.extensions(); + QByteArray all; + foreach (const QByteArray &e, exts) all += ' ' + e; + qDebug() << "GL_EXTENSIONS: " << all.constData(); + + m_brokenMipmapSupport = version.contains("Mesa 10.1") || version.contains("Mesa 9."); + qDebug() << "Broken Mipmap: " << m_brokenMipmapSupport; + + context.doneCurrent(); + } #endif } @@ -231,6 +237,10 @@ public: void tst_SceneGraph::manyWindows() { + if ((QGuiApplication::platformName() == QLatin1String("offscreen")) + || (QGuiApplication::platformName() == QLatin1String("minimal"))) + QSKIP("Skipping due to grabWindow not functional on offscreen/minimimal platforms"); + QFETCH(QString, file); QFETCH(bool, toplevel); QFETCH(bool, shared); @@ -430,12 +440,8 @@ void tst_SceneGraph::render_data() void tst_SceneGraph::render() { - QQuickView dummy; - dummy.show(); - QTest::qWaitForWindowExposed(&dummy); - if (dummy.rendererInterface()->graphicsApi() != QSGRendererInterface::OpenGL) + if (!isRunningOnOpenGL()) QSKIP("Skipping complex rendering tests due to not running with OpenGL"); - dummy.hide(); QFETCH(QString, file); QFETCH(QList, baseStage); @@ -485,6 +491,9 @@ void tst_SceneGraph::render() // current on the other window. void tst_SceneGraph::hideWithOtherContext() { + if (!isRunningOnOpenGL()) + QSKIP("Skipping OpenGL context test due to not running with OpenGL"); + QWindow window; window.setSurfaceType(QWindow::OpenGLSurface); window.resize(100, 100); @@ -500,9 +509,6 @@ void tst_SceneGraph::hideWithOtherContext() view.show(); QVERIFY(QTest::qWaitForWindowExposed(&view)); - if (view.rendererInterface()->graphicsApi() != QSGRendererInterface::OpenGL) - QSKIP("Skipping OpenGL context test due to not running with OpenGL"); - renderingOnMainThread = view.openglContext()->thread() == QGuiApplication::instance()->thread(); // Make the local context current on the local window... @@ -549,6 +555,17 @@ void tst_SceneGraph::createTextureFromImage() QCOMPARE(texture->hasAlphaChannel(), expectedAlpha); } +bool tst_SceneGraph::isRunningOnOpenGL() +{ + bool retval = false; + QQuickView dummy; + dummy.show(); + QTest::qWaitForWindowExposed(&dummy); + if (dummy.rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL) + retval = true; + dummy.hide(); + return retval; +} #include "tst_scenegraph.moc" diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp index 537fe99012..c0db9c733d 100644 --- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp +++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp @@ -368,6 +368,10 @@ void tst_qquickwidget::reparentToNewWindow() QSignalSpy afterRenderingSpy(qqw->quickWindow(), &QQuickWindow::afterRendering); qqw->setParent(&window2); qqw->show(); + + if (QGuiApplication::platformName() == QLatin1String("offscreen")) + QEXPECT_FAIL("", "afterRendering not emitted after reparenting on offscreen", Continue); + QTRY_VERIFY(afterRenderingSpy.size() > 0); QImage img = qqw->grabFramebuffer(); -- cgit v1.2.3