diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-14 18:46:38 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-10-14 19:02:37 +0200 |
commit | c2f8b9535d34da6948ccf45b7d5fd90de2f1bc9e (patch) | |
tree | c6f7e058a985d7c18b51cadc76283caf555071c9 /tests/manual/scenegraph_lancelot/scenegraph | |
parent | 9e633bbda7608ac0231809e2a6a97ae8f2d849d6 (diff) | |
parent | 803f18f02e5609a1ca00a5b78ea6d3613d44e1a0 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Removed dependencies.yaml because we don't use it yet in wip/cmake.
Fixed conflict in qmlcachegen.cpp.
Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
Diffstat (limited to 'tests/manual/scenegraph_lancelot/scenegraph')
-rw-r--r-- | tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro | 4 | ||||
-rw-r--r-- | tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp | 24 |
2 files changed, 19 insertions, 9 deletions
diff --git a/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro b/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro index 65819ab5bf..dd0ef268b1 100644 --- a/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro +++ b/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro @@ -9,3 +9,7 @@ SOURCES += tst_scenegraph.cpp # Include Lancelot protocol code to communicate with baseline server. # Assuming that we are in a normal Qt5 source code tree include(../../../../../qtbase/tests/baselineserver/shared/qbaselinetest.pri) + +TEST_HELPER_INSTALLS += .././qmlscenegrabber + +TESTDATA += ../data diff --git a/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp b/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp index 3f28d90e7b..40b17ec2a2 100644 --- a/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp +++ b/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp @@ -68,6 +68,7 @@ private: bool renderAndGrab(const QString& qmlFile, const QStringList& extraArgs, QImage *screenshot, QString *errMsg); quint16 checksumFileOrDir(const QString &path); + QString testSuitePath; int consecutiveErrors; // Not test failures (image mismatches), but system failures (so no image at all) bool aborted; // This run given up because of too many system failures }; @@ -81,6 +82,18 @@ tst_Scenegraph::tst_Scenegraph() void tst_Scenegraph::initTestCase() { + QString dataDir = QFINDTESTDATA("../data/."); + if (dataDir.isEmpty()) + dataDir = QStringLiteral("data"); + QFileInfo fi(dataDir); + if (!fi.exists() || !fi.isDir() || !fi.isReadable()) + QSKIP("Test suite data directory missing or unreadable: " + fi.canonicalFilePath().toLatin1()); + testSuitePath = fi.canonicalFilePath(); + + const char *backendVarName = "QT_QUICK_BACKEND"; + const QString backend = qEnvironmentVariable(backendVarName, QString::fromLatin1("default")); + QBaselineTest::addClientProperty(QString::fromLatin1(backendVarName), backend); + QByteArray msg; if (!QBaselineTest::connectToBaselineServer(&msg)) QSKIP(msg); @@ -91,7 +104,7 @@ void tst_Scenegraph::cleanup() { // Allow subsystems time to settle if (!aborted) - QTest::qWait(200); + QTest::qWait(20); } void tst_Scenegraph::testNoTextRendering_data() @@ -127,13 +140,6 @@ void tst_Scenegraph::setupTestSuite(const QByteArray& filter) QTest::addColumn<QString>("qmlFile"); int numItems = 0; - QString testSuiteDir = QLatin1String("data"); - QString testSuiteLocation = QCoreApplication::applicationDirPath(); - QString testSuitePath = testSuiteLocation + QDir::separator() + testSuiteDir; - QFileInfo fi(testSuitePath); - if (!fi.exists() || !fi.isDir() || !fi.isReadable()) - QSKIP("Test suite data directory missing or unreadable: " + testSuitePath.toLatin1()); - QStringList ignoreItems; QFile ignoreFile(testSuitePath + "/Ignore"); if (ignoreFile.open(QIODevice::ReadOnly)) { @@ -233,7 +239,7 @@ quint16 tst_Scenegraph::checksumFileOrDir(const QString &path) QFile f(path); f.open(QIODevice::ReadOnly); QByteArray contents = f.readAll(); - return qChecksum(contents.constData(), contents.size()); + return qChecksum(contents.constData(), uint(contents.size())); } if (fi.isDir()) { static const QStringList nameFilters = QStringList() << "*.qml" << "*.cpp" << "*.png" << "*.jpg"; |