From 4fe68ffbe5c93244562f2b56292d4ecf5ce39f56 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 10 Apr 2015 13:55:10 +0200 Subject: Add GPU_BLACKLIST support to QTestLib In addition to BLACKLIST, Qt will now look for GPU_BLACKLIST too. Test cases that are specified as disabled in the GPU blacklist will be skipped. This is particularly relevant when running tests on Embedded Linux devices. For example, the following JSON would configure the test case glxContextWrap to be skipped on drivers where GL_VENDOR contains UnstableDriverVendor: { "entries": [ { "gl_vendor": "UnstableDriverVendor", "features": [ "disable_glxContextWrap" ] } ] } In contrast to the regular blacklist, GPU-blacklisted test cases are not run at all. This is because driver problems and instabilities often lead to crashes. Change-Id: I340cf5c0261a206109b78409774408981bba5c68 Reviewed-by: Friedemann Kleint Reviewed-by: Simon Hausmann --- src/gui/opengl/qopengl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gui/opengl/qopengl.cpp') diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp index 622e0147465..1c008ccb42c 100644 --- a/src/gui/opengl/qopengl.cpp +++ b/src/gui/opengl/qopengl.cpp @@ -47,6 +47,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE #if defined(QT_OPENGL_3) @@ -474,4 +476,13 @@ QOpenGLConfig::Gpu QOpenGLConfig::Gpu::fromContext() return gpu; } +Q_GUI_EXPORT std::set *qgpu_features(const QString &filename) +{ + const QSet features = QOpenGLConfig::gpuFeatures(QOpenGLConfig::Gpu::fromContext(), filename); + std::set *result = new std::set; + foreach (const QString &feature, features) + result->insert(feature.toUtf8()); + return result; +} + QT_END_NAMESPACE -- cgit v1.2.3