diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-06-04 05:56:06 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2015-06-04 05:56:06 +0000 |
commit | ccad00121d0a9d703cf715c54347b32bfc33bbfc (patch) | |
tree | 8e492f00f9ea81d87ae9126ad06c3dbc21fee3a3 /src/testlib/qtestblacklist.cpp | |
parent | dc2617f35be61b4827b8e3d192c85e2feacf7f6a (diff) | |
parent | e2f66f921594b7be4af4a058c959557489e86879 (diff) |
Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev
Diffstat (limited to 'src/testlib/qtestblacklist.cpp')
-rw-r--r-- | src/testlib/qtestblacklist.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index bfeca08617..f9ce908a00 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -34,6 +34,7 @@ #include "qtestresult_p.h" #include <QtTest/qtestcase.h> +#include <QtTest/qtest.h> #include <QtCore/qbytearray.h> #include <QtCore/qfile.h> #include <QtCore/qset.h> @@ -161,6 +162,9 @@ static bool checkCondition(const QByteArray &condition) static bool ignoreAll = false; static std::set<QByteArray> *ignoredTests = 0; +static std::set<QByteArray> *gpuFeatures = 0; + +Q_TESTLIB_EXPORT std::set<QByteArray> *(*qgpu_features_ptr)(const QString &) = 0; namespace QTestPrivate { @@ -196,7 +200,18 @@ void parseBlackList() } } -void checkBlackList(const char *slot, const char *data) +void parseGpuBlackList() +{ + if (!qgpu_features_ptr) + return; + QString filename = QTest::qFindTestData(QStringLiteral("GPU_BLACKLIST")); + if (filename.isEmpty()) + return; + if (!gpuFeatures) + gpuFeatures = qgpu_features_ptr(filename); +} + +void checkBlackLists(const char *slot, const char *data) { bool ignore = ignoreAll; @@ -211,6 +226,16 @@ void checkBlackList(const char *slot, const char *data) } QTestResult::setBlacklistCurrentTest(ignore); + + // Tests blacklisted in GPU_BLACKLIST are to be skipped. Just ignoring the result is + // not sufficient since these are expected to crash or behave in undefined ways. + if (!ignore && gpuFeatures) { + const QByteArray disableKey = QByteArrayLiteral("disable_") + QByteArray(slot); + if (gpuFeatures->find(disableKey) != gpuFeatures->end()) { + const QByteArray msg = QByteArrayLiteral("Skipped due to GPU blacklist: ") + disableKey; + QTest::qSkip(msg.constData(), __FILE__, __LINE__); + } + } } } |