diff options
author | Caroline Chao <caroline.chao@theqtcompany.com> | 2015-06-08 13:50:34 +0200 |
---|---|---|
committer | Caroline Chao <caroline.chao@theqtcompany.com> | 2015-06-10 12:47:18 +0000 |
commit | 1dfc16f6dad1cfbd843af5ca91bbb8e02774930d (patch) | |
tree | 1c483606d8cafc1c01085b351c44bc993013e104 /src/testlib | |
parent | d884420b94abc637b2fcef6585a1fb5c93b69c2c (diff) |
QTestLib: Add data support to GPU_BLACKLIST
Follows the change 4fe68ffbe5c.
Test cases run while using a given data can now also be skipped.
The data follows the test function to skip in the features line:
"features": [ "disable_functionToSkip:dataToSkip" ]
Change-Id: I46445e3bed34d7d6507e7ccaaed4b83ab9b9a092
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestblacklist.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index f9ce908a00..dca51983de 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -166,6 +166,17 @@ static std::set<QByteArray> *gpuFeatures = 0; Q_TESTLIB_EXPORT std::set<QByteArray> *(*qgpu_features_ptr)(const QString &) = 0; +static bool isGPUTestBlacklisted(const char *slot) +{ + 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__); + return true; + } + return false; +} + namespace QTestPrivate { void parseBlackList() @@ -230,10 +241,12 @@ void checkBlackLists(const char *slot, const char *data) // 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__); + QByteArray s_gpu = slot; + ignore = isGPUTestBlacklisted(s_gpu); + if (!ignore && data) { + s_gpu += ':'; + s_gpu += data; + isGPUTestBlacklisted(s_gpu); } } } |