From 510770c464e413f5758c5e64e9770f222c7e6bd0 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Thu, 28 Nov 2019 15:39:52 +0100 Subject: Facilitate testing RHI rendering in the lancelot test Synthesize a "GraphicsStack" client attribute from the various environment variables that determine the rendering backend. This allows the baseline server to differentiate the baselines from the different rendering stacks. Manual comparison between them can then be done using the -compareto command line option. Change-Id: Iea13e130baa97462461ccf8b769d57ea74567c51 Reviewed-by: Laszlo Agocs Reviewed-by: Allan Sandfeld Jensen --- .../scenegraph/tst_scenegraph.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tests/manual/scenegraph_lancelot') diff --git a/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp b/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp index 86945e71a4..3cc83e94da 100644 --- a/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp +++ b/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp @@ -72,6 +72,7 @@ private: 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 + bool usingRhi; }; @@ -105,6 +106,23 @@ void tst_Scenegraph::initTestCase() const QString backend = qEnvironmentVariable(backendVarName, QString::fromLatin1("default")); QBaselineTest::addClientProperty(QString::fromLatin1(backendVarName), backend); +#if defined(Q_OS_WIN) + const char *defaultRhiBackend = "d3d11"; +#elif defined(Q_OS_DARWIN) + const char *defaultRhiBackend = "metal"; +#else + const char *defaultRhiBackend = "opengl"; +#endif + usingRhi = qEnvironmentVariableIntValue("QSG_RHI") != 0; + QString stack; + if (usingRhi) { + const QString rhiBackend = qEnvironmentVariable("QSG_RHI_BACKEND", QString::fromLatin1(defaultRhiBackend)); + stack = QString::fromLatin1("RHI_%1").arg(rhiBackend); + } else { + stack = qEnvironmentVariable("QT_QUICK_BACKEND", QString::fromLatin1("DirectGL")); + } + QBaselineTest::addClientProperty(QString::fromLatin1("GraphicsStack"), stack); + QByteArray msg; if (!QBaselineTest::connectToBaselineServer(&msg)) QSKIP(msg); @@ -134,7 +152,7 @@ void tst_Scenegraph::testNoTextRendering() void tst_Scenegraph::testRendering_data() { - setupTestSuite(); + setupTestSuite(usingRhi ? "shaders/" : ""); // on RHI, skip shader effects tests for now consecutiveErrors = 0; aborted = false; } -- cgit v1.2.3