diff options
author | Andy Nichols <andy.nichols@qt.io> | 2016-04-26 11:49:52 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@qt.io> | 2016-05-06 19:17:28 +0000 |
commit | 928915cabe4b8efacf9766962b60f895f51b6b98 (patch) | |
tree | 708242f045390621702d3c94251cfdea7ab36ab7 /tests/auto/quick | |
parent | 11e788c9a555694f3ec5c4839eb98c4048801bf2 (diff) |
Fix some test failures with QT_NO_OPENGL builds
Change-Id: I4154084b4a0e0709ee8cb39a856a37a611e2d537
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r-- | tests/auto/quick/examples/tst_examples.cpp | 12 | ||||
-rw-r--r-- | tests/auto/quick/qquickflickable/tst_qquickflickable.cpp | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquickimage/tst_qquickimage.cpp | 5 | ||||
-rw-r--r-- | tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp | 9 | ||||
-rw-r--r-- | tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp | 16 | ||||
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 7 | ||||
-rw-r--r-- | tests/auto/quick/quick.pro | 4 |
7 files changed, 44 insertions, 11 deletions
diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp index 548b20a80a..3087cfbd9d 100644 --- a/tests/auto/quick/examples/tst_examples.cpp +++ b/tests/auto/quick/examples/tst_examples.cpp @@ -104,6 +104,18 @@ tst_examples::tst_examples() excludedFiles << "views/visualdatamodel/slideshow.qml"; #endif +#ifdef QT_NO_OPENGL + //No support for Particles + excludedFiles << "examples/qml/dynamicscene/dynamicscene.qml"; + excludedFiles << "examples/quick/animation/basics/color-animation.qml"; + excludedFiles << "examples/quick/particles/affectors/content/age.qml"; + excludedFiles << "examples/quick/touchinteraction/multipointtouch/bearwhack.qml"; + excludedFiles << "examples/quick/touchinteraction/multipointtouch/multiflame.qml"; + excludedDirs << "examples/quick/particles"; + // No Support for ShaderEffect + excludedFiles << "src/quick/doc/snippets/qml/animators.qml"; +#endif + } tst_examples::~tst_examples() diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp index 006c55542a..2742f5c1e2 100644 --- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp +++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp @@ -1137,7 +1137,9 @@ void tst_qquickflickable::flickOnRelease() QTRY_VERIFY(!flickable->isMoving()); #ifdef Q_OS_MAC +# ifndef QT_NO_OPENGL QEXPECT_FAIL("", "QTBUG-26094 stopping on a full pixel doesn't work on OS X", Continue); +# endif #endif // Stop on a full pixel after user interaction QCOMPARE(flickable->contentY(), (qreal)qRound(flickable->contentY())); diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp index 9274a1ac9e..d345163db5 100644 --- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp +++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp @@ -306,6 +306,7 @@ void tst_qquickimage::mirror() qreal width = 300; qreal height = 250; + qreal devicePixelRatio = 1.0; foreach (QQuickImage::FillMode fillMode, fillModes) { #if defined(Q_OS_BLACKBERRY) @@ -325,13 +326,15 @@ void tst_qquickimage::mirror() QImage screenshot = window->grabWindow(); screenshots[fillMode] = screenshot; + devicePixelRatio = window->devicePixelRatio(); } foreach (QQuickImage::FillMode fillMode, fillModes) { QPixmap srcPixmap; QVERIFY(srcPixmap.load(testFile("pattern.png"))); - QPixmap expected(width, height); + QPixmap expected(width * (int)devicePixelRatio, height * (int)devicePixelRatio); + expected.setDevicePixelRatio(devicePixelRatio); expected.fill(); QPainter p_e(&expected); QTransform transform; diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp index 6cfe43fd9f..d991f189fc 100644 --- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp +++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp @@ -60,9 +60,10 @@ private slots: void initTestCase() Q_DECL_OVERRIDE; void layerEnabled(); void layerSmooth(); +#ifndef QT_NO_OPENGL void layerMipmap(); void layerEffect(); - +#endif void layerVisibility_data(); void layerVisibility(); @@ -169,8 +170,7 @@ void tst_QQuickItemLayer::layerEnabled() QVERIFY(fb.pixel(0, 0) != fb.pixel(0, fb.height() - 1)); } - - +#ifndef QT_NO_OPENGL // The test draws a one pixel wide line and scales it down by more than a a factor 2 // If mipmpping works, the pixels should be gray, not white or black @@ -196,8 +196,7 @@ void tst_QQuickItemLayer::layerEffect() QCOMPARE(fb.pixel(0, 0), qRgb(0xff, 0, 0)); QCOMPARE(fb.pixel(fb.width() - 1, 0), qRgb(0, 0xff, 0)); } - - +#endif // The test draws a rectangle and verifies that there is padding on each side // as the source rect spans outside the item. The padding is verified using diff --git a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp index 1a04526f61..44d7b40ed9 100644 --- a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp +++ b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp @@ -32,8 +32,11 @@ #include <QtQuick/qquickview.h> #include <private/qquickitem_p.h> +#ifndef QT_NO_OPENGL #include <private/qsgdefaultpainternode_p.h> - +#else +#include <private/qsgsoftwarepainternode_p.h> +#endif class tst_QQuickPaintedItem: public QObject { Q_OBJECT @@ -70,7 +73,7 @@ public: ++paintRequests; clipRect = painter->clipBoundingRect(); } - +#ifndef QT_NO_OPENGL QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) { paintNode = static_cast<QSGDefaultPainterNode *>(QQuickPaintedItem::updatePaintNode(oldNode, data)); @@ -78,6 +81,15 @@ public: } QSGDefaultPainterNode *paintNode; +#else + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) + { + paintNode = static_cast<QSGSoftwarePainterNode *>(QQuickPaintedItem::updatePaintNode(oldNode, data)); + return paintNode; + } + + QSGSoftwarePainterNode *paintNode; +#endif int paintRequests; QRectF clipRect; }; diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index eed81389f6..0e4ad86260 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -1240,9 +1240,10 @@ void tst_qquickwindow::headless() QSignalSpy initialized(window, SIGNAL(sceneGraphInitialized())); QSignalSpy invalidated(window, SIGNAL(sceneGraphInvalidated())); +#ifndef QT_NO_OPENGL // Verify that the window is alive and kicking QVERIFY(window->openglContext() != 0); - +#endif // Store the visual result QImage originalContent = window->grabWindow(); @@ -1270,7 +1271,9 @@ void tst_qquickwindow::headless() if (threaded) QTRY_COMPARE(initialized.size(), 1); +#ifndef QT_NO_OPENGL QVERIFY(window->openglContext() != 0); +#endif // Verify that the visual output is the same QImage newContent = window->grabWindow(); @@ -1643,7 +1646,9 @@ void tst_qquickwindow::hideThenDelete() } QVERIFY(sgInvalidated->size() > 0); +#ifndef QT_NO_OPENGL QVERIFY(openglDestroyed->size() > 0); +#endif } void tst_qquickwindow::showHideAnimate() diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index e1ed4418f1..a528810cae 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -13,7 +13,8 @@ contains(QT_CONFIG, opengl(es1|es2)?) { qquickanimatedsprite \ qquickframebufferobject \ qquickopenglinfo \ - qquickspritesequence + qquickspritesequence \ + qquickshadereffect } !cross_compile: PRIVATETESTS += examples @@ -72,7 +73,6 @@ QUICKTESTS = \ qquickrectangle \ qquickrendererinfo \ qquickrepeater \ - qquickshadereffect \ qquickshortcut \ qquicktext \ qquicktextdocument \ |