summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtest.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-04-10 13:55:10 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-05-08 15:11:32 +0000
commit4fe68ffbe5c93244562f2b56292d4ecf5ce39f56 (patch)
treeac8b39a6630ad35495a539bf8599b5590310e27d /src/testlib/qtest.h
parente6ffb36b5517d1d4025718b56423db9bdf0a63f8 (diff)
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 <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/testlib/qtest.h')
-rw-r--r--src/testlib/qtest.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 70e923927b..994179958b 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -289,6 +289,18 @@ int main(int argc, char *argv[]) \
}
#include <QtTest/qtestsystem.h>
+#include <set>
+
+#ifndef QT_NO_OPENGL
+# define QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS \
+ extern Q_TESTLIB_EXPORT std::set<QByteArray> *(*qgpu_features_ptr)(const QString &); \
+ extern Q_GUI_EXPORT std::set<QByteArray> *qgpu_features(const QString &);
+# define QTEST_ADD_GPU_BLACKLIST_SUPPORT \
+ qgpu_features_ptr = qgpu_features;
+#else
+# define QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS
+# define QTEST_ADD_GPU_BLACKLIST_SUPPORT
+#endif
#if defined(QT_WIDGETS_LIB)
@@ -301,11 +313,15 @@ int main(int argc, char *argv[]) \
#endif
#define QTEST_MAIN(TestObject) \
+QT_BEGIN_NAMESPACE \
+QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS \
+QT_END_NAMESPACE \
int main(int argc, char *argv[]) \
{ \
QApplication app(argc, argv); \
app.setAttribute(Qt::AA_Use96Dpi, true); \
QTEST_DISABLE_KEYPAD_NAVIGATION \
+ QTEST_ADD_GPU_BLACKLIST_SUPPORT \
TestObject tc; \
QTEST_SET_MAIN_SOURCE_PATH \
return QTest::qExec(&tc, argc, argv); \
@@ -316,10 +332,14 @@ int main(int argc, char *argv[]) \
#include <QtTest/qtest_gui.h>
#define QTEST_MAIN(TestObject) \
+QT_BEGIN_NAMESPACE \
+QTEST_ADD_GPU_BLACKLIST_SUPPORT_DEFS \
+QT_END_NAMESPACE \
int main(int argc, char *argv[]) \
{ \
QGuiApplication app(argc, argv); \
app.setAttribute(Qt::AA_Use96Dpi, true); \
+ QTEST_ADD_GPU_BLACKLIST_SUPPORT \
TestObject tc; \
QTEST_SET_MAIN_SOURCE_PATH \
return QTest::qExec(&tc, argc, argv); \