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>
This commit is contained in:
parent
dc3dd4f634
commit
49ea02f435
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user