summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-07 09:42:41 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-08-11 09:30:39 +0000
commit49ea02f435876d514898d587700a21e1a8972f09 (patch)
tree701b2da48b4566bedef57990efdb812ef8c51523 /tests/auto
parentdc3dd4f634f31ce695033580394758f93911120d (diff)
windows: Verify the built-in GPU blacklist in autotests
Have an autotest to prevent introducing JSON syntax errors that become apparent only at runtime. Change-Id: If2bcbf4d227fddcbeb9c095b7986bada078131d7 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
index 3bf59910f3..48a15641b2 100644
--- a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
+++ b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
@@ -47,6 +47,7 @@
#include <QtCore/QVariant>
#include <QtCore/QDebug>
#include <QtCore/QTextStream>
+#include <QtCore/QJsonDocument>
#include <algorithm>
@@ -107,6 +108,7 @@ private slots:
void testConfiguration();
void testGlConfiguration();
void testBugList();
+ void testDefaultWindowsBlacklist();
};
static void dumpConfiguration(QTextStream &str)
@@ -284,6 +286,20 @@ void tst_QOpenGlConfig::testBugList()
msgSetMismatch(expectedFeatures, actualFeatures));
}
+void tst_QOpenGlConfig::testDefaultWindowsBlacklist()
+{
+ if (qGuiApp->platformName() != QStringLiteral("windows"))
+ QSKIP("Only applicable to Windows");
+
+ QFile f(QStringLiteral(":/qt-project.org/windows/openglblacklists/default.json"));
+ QVERIFY(f.open(QIODevice::ReadOnly | QIODevice::Text));
+ QJsonParseError err;
+ QJsonDocument doc = QJsonDocument::fromJson(f.readAll(), &err);
+ QVERIFY2(err.error == 0,
+ QStringLiteral("Failed to parse built-in Windows GPU blacklist. %1 : %2")
+ .arg(err.offset).arg(err.errorString()).toLatin1());
+}
+
QTEST_MAIN(tst_QOpenGlConfig)
#include "tst_qopenglconfig.moc"