summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@theqtcompany.com>2015-06-08 15:07:43 +0200
committerCaroline Chao <caroline.chao@theqtcompany.com>2015-06-10 12:47:22 +0000
commit9545bee98a2431d4ef4c3449631a5fcb8d9bd57a (patch)
treec50b894bee076139fb5e8adfc57f76e973401936 /src/testlib
parent1dfc16f6dad1cfbd843af5ca91bbb8e02774930d (diff)
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 <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestblacklist.cpp8
1 files changed, 5 insertions, 3 deletions
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<QByteArray> *gpuFeatures = 0;
Q_TESTLIB_EXPORT std::set<QByteArray> *(*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;