From 9545bee98a2431d4ef4c3449631a5fcb8d9bd57a Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Mon, 8 Jun 2015 15:07:43 +0200 Subject: QTestLib: Add data parameter to SKIP message if any When using GPU_BLACKLIST, a blacklisted test is volontary skipped early in the process to avoid crashes or undefined bahaviors. Thus the name of the running test only contains the slot name and doesn't show which data was eventually used. If a test is skipped while running with different data, the skip message currently doesn't tell which data was run either. To identify the skipped test, when the test is run with data, the data is now amended to the slot name in the skip message. Change-Id: I7acdc8951fa2c60d170cc77c0fbd842255746b35 Reviewed-by: Laszlo Agocs --- src/testlib/qtestblacklist.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/testlib/qtestblacklist.cpp') diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index dca51983de..eb7abdad46 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -166,11 +166,13 @@ static std::set *gpuFeatures = 0; Q_TESTLIB_EXPORT std::set *(*qgpu_features_ptr)(const QString &) = 0; -static bool isGPUTestBlacklisted(const char *slot) +static bool isGPUTestBlacklisted(const char *slot, const char *data = 0) { const QByteArray disableKey = QByteArrayLiteral("disable_") + QByteArray(slot); if (gpuFeatures->find(disableKey) != gpuFeatures->end()) { - const QByteArray msg = QByteArrayLiteral("Skipped due to GPU blacklist: ") + disableKey; + QByteArray msg = QByteArrayLiteral("Skipped due to GPU blacklist: ") + disableKey; + if (data) + msg += QByteArrayLiteral(":") + QByteArray(data); QTest::qSkip(msg.constData(), __FILE__, __LINE__); return true; } @@ -242,7 +244,7 @@ void checkBlackLists(const char *slot, const char *data) // not sufficient since these are expected to crash or behave in undefined ways. if (!ignore && gpuFeatures) { QByteArray s_gpu = slot; - ignore = isGPUTestBlacklisted(s_gpu); + ignore = isGPUTestBlacklisted(s_gpu, data); if (!ignore && data) { s_gpu += ':'; s_gpu += data; -- cgit v1.2.3