diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-11-04 15:30:47 +0100 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-11-07 11:57:34 +0100 |
commit | f05c9c292b5ee19e5e44709e44a9509d3300632f (patch) | |
tree | 56cace6da85c7b26a3c917cd0851bf98ff586494 /tests/manual/scenegraph_lancelot/scenegraph | |
parent | b7c2d5dfa61c17f1fd06a5abd8ef254c308830c7 (diff) |
lancelot graphics test: Use application bundle on Mac
Font handling has been observed to differ depending on the presence of
the Info.plist file in the app bundle. We want to test the typical use
case, so make the qmlscenegrabber executable be a bundled app.
Change-Id: I2e8b96328b16d5bedfeb5f6dd23f20c06d4c60c1
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
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 | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro b/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro index dd0ef268b1..9deb46427e 100644 --- a/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro +++ b/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro @@ -10,6 +10,8 @@ SOURCES += tst_scenegraph.cpp # Assuming that we are in a normal Qt5 source code tree include(../../../../../qtbase/tests/baselineserver/shared/qbaselinetest.pri) -TEST_HELPER_INSTALLS += .././qmlscenegrabber +win32: TEST_HELPER_INSTALLS += .././qmlscenegrabber.exe +else: macos: TEST_HELPER_INSTALLS += .././qmlscenegrabber.app +else: 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 40b17ec2a2..465e2a7d54 100644 --- a/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp +++ b/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp @@ -69,6 +69,7 @@ private: quint16 checksumFileOrDir(const QString &path); QString testSuitePath; + QString grabberPath; 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 }; @@ -90,6 +91,16 @@ void tst_Scenegraph::initTestCase() QSKIP("Test suite data directory missing or unreadable: " + fi.canonicalFilePath().toLatin1()); testSuitePath = fi.canonicalFilePath(); +#if defined(Q_OS_WIN) + grabberPath = QFINDTESTDATA("qmlscenegrabber.exe"); +#elif defined(Q_OS_DARWIN) + grabberPath = QFINDTESTDATA("qmlscenegrabber.app/Contents/MacOS/qmlscenegrabber"); +#else + grabberPath = QFINDTESTDATA("qmlscenegrabber"); +#endif + if (grabberPath.isEmpty()) + grabberPath = QCoreApplication::applicationDirPath() + "/qmlscenegrabber"; + const char *backendVarName = "QT_QUICK_BACKEND"; const QString backend = qEnvironmentVariable(backendVarName, QString::fromLatin1("default")); QBaselineTest::addClientProperty(QString::fromLatin1(backendVarName), backend); @@ -201,11 +212,10 @@ bool tst_Scenegraph::renderAndGrab(const QString& qmlFile, const QStringList& ex { bool usePipe = true; // Whether to transport the grabbed image using temp. file or pipe. TBD: cmdline option QProcess grabber; - QString cmd = QCoreApplication::applicationDirPath() + "/qmlscenegrabber"; QStringList args = extraArgs; QString tmpfile = usePipe ? QString("-") : QString("/tmp/qmlscenegrabber-%1-out.ppm").arg(QCoreApplication::applicationPid()); args << qmlFile << "-o" << tmpfile; - grabber.start(cmd, args, QIODevice::ReadOnly); + grabber.start(grabberPath, args, QIODevice::ReadOnly); grabber.waitForFinished(17000); //### hardcoded, must be larger than the scene timeout in qmlscenegrabber if (grabber.state() != QProcess::NotRunning) { grabber.terminate(); |