diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-11-28 15:39:52 +0100 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-11-29 10:05:24 +0000 |
commit | 510770c464e413f5758c5e64e9770f222c7e6bd0 (patch) | |
tree | 61094d794753bcd346a46154ce07ff70bb760bc7 /tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp | |
parent | fcf7b513d9e5b04213fbe5254f10af0f694ea8aa (diff) | |
download | qtdeclarative-510770c464e413f5758c5e64e9770f222c7e6bd0.tar.gz |
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 <laszlo.agocs@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp')
-rw-r--r-- | tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
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; } |