OpenCoverage

qtestblacklist.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/testlib/qtestblacklist.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5static QSet<QByteArray> keywords()-
6{-
7-
8 QSet<QByteArray> set = QSet<QByteArray>()-
9 << "*"-
10-
11 << "linux"-
12 << "64bit"-
13-
14-
15-
16-
17-
18 << "gcc"-
19 << "x86"-
20-
21-
22-
23-
24-
25-
26 << "developer-build"-
27-
28 ;-
29-
30 QCoreApplication *app = QCoreApplication::instance();-
31 if (app
appDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
) {
0-2
32 const QVariant platformName = app->property("platformName");-
33 if (platformName.isValid()
platformName.isValid()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
)
0-2
34 set
never executed: set << platformName.toByteArray();
<< platformName.toByteArray();
never executed: set << platformName.toByteArray();
0
35 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
2
36-
37 return
executed 2 times by 1 test: return set;
Executed by:
  • tst_selftests - unknown status
set;
executed 2 times by 1 test: return set;
Executed by:
  • tst_selftests - unknown status
2
38}-
39-
40static QSet<QByteArray> activeConditions()-
41{-
42 QSet<QByteArray> result = keywords();-
43-
44 QByteArray distributionName = QSysInfo::productType().toLower().toUtf8();-
45 QByteArray distributionRelease = QSysInfo::productVersion().toLower().toUtf8();-
46 if (!distributionName.isEmpty()
!distributionName.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
) {
0-2
47 if (result.find(distributionName) == result.end()
result.find(di...= result.end()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
)
0-2
48 result.insert(distributionName);
executed 2 times by 1 test: result.insert(distributionName);
Executed by:
  • tst_selftests - unknown status
2
49 if (!distributionRelease.isEmpty()
!distributionRelease.isEmpty()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
) {
0-2
50 QByteArray versioned = distributionName + "-" + distributionRelease;-
51 if (result.find(versioned) == result.end()
result.find(ve...= result.end()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
)
0-2
52 result.insert(versioned);
executed 2 times by 1 test: result.insert(versioned);
Executed by:
  • tst_selftests - unknown status
2
53 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
2
54 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
2
55-
56 return
executed 2 times by 1 test: return result;
Executed by:
  • tst_selftests - unknown status
result;
executed 2 times by 1 test: return result;
Executed by:
  • tst_selftests - unknown status
2
57}-
58-
59static bool checkCondition(const QByteArray &condition)-
60{-
61 static const QSet<QByteArray> matchedConditions = activeConditions();-
62 QList<QByteArray> conds = condition.split(' ');-
63-
64 for (int i = 0; i < conds.size()
i < conds.size()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
; ++i) {
12
65 QByteArray c = conds.at(i);-
66 bool result = c.startsWith('!');-
67 if (result
resultDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
)
0-12
68 c = c.mid(1);
never executed: c = c.mid(1);
0
69-
70 result ^= matchedConditions.contains(c);-
71 if (!result
!resultDescription
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
)
0-12
72 return
never executed: return false;
false;
never executed: return false;
0
73 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
12
74 return
executed 12 times by 1 test: return true;
Executed by:
  • tst_selftests - unknown status
true;
executed 12 times by 1 test: return true;
Executed by:
  • tst_selftests - unknown status
12
75}-
76-
77static bool ignoreAll = false;-
78static std::set<QByteArray> *ignoredTests = 0;-
79static std::set<QByteArray> *gpuFeatures = 0;-
80-
81__attribute__((visibility("default"))) std::set<QByteArray> *(*qgpu_features_ptr)(const QString &) = 0;-
82-
83static bool isGPUTestBlacklisted(const char *slot, const char *data = 0)-
84{-
85 const QByteArray disableKey = ([]() -> QByteArray { enum { Size = sizeof("disable_") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "disable_" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return
never executed: return ba;
ba;
never executed: return ba;
}()) + QByteArray(slot);
0
86 if (gpuFeatures->find(disableKey) != gpuFeatures->end()
gpuFeatures->f...eatures->end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
87 QByteArray msg = ([]() -> QByteArray { enum { Size = sizeof("Skipped due to GPU blacklist: ") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "Skipped due to GPU blacklist: " }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return
never executed: return ba;
ba;
never executed: return ba;
}()) + disableKey;
0
88 if (data
dataDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
89 msg += ':' + QByteArray(data);
never executed: msg += ':' + QByteArray(data);
0
90 QTest::qSkip(msg.constData(), __FILE__, 218);-
91 return
never executed: return true;
true;
never executed: return true;
0
92 }-
93 return
never executed: return false;
false;
never executed: return false;
0
94}-
95-
96namespace QTestPrivate {-
97-
98void parseBlackList()-
99{-
100 QString filename = QTest::qFindTestData(([]() -> QString { enum { Size = sizeof(u"" "BLACKLIST")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "BLACKLIST" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 815 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_selftests - unknown status
qstring_literal_temp;
executed 815 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_selftests - unknown status
}()));
815
101 if (filename.isEmpty()
filename.isEmpty()Description
TRUEevaluated 813 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
)
2-813
102 return;
executed 813 times by 1 test: return;
Executed by:
  • tst_selftests - unknown status
813
103 QFile ignored(filename);-
104 if (!ignored.open(QIODevice::ReadOnly)
!ignored.open(...ice::ReadOnly)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
)
0-2
105 return;
never executed: return;
0
106-
107 QByteArray function;-
108-
109 while (!ignored.atEnd()
!ignored.atEnd()Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
) {
2-24
110 QByteArray line = ignored.readLine().simplified();-
111 if (line.isEmpty()
line.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
|| line.startsWith('#')
line.startsWith('#')Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
)
0-24
112 continue;
never executed: continue;
0
113 if (line.startsWith('[')
line.startsWith('[')Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
) {
12
114 function = line.mid(1, line.length() - 2);-
115 continue;
executed 12 times by 1 test: continue;
Executed by:
  • tst_selftests - unknown status
12
116 }-
117 bool condition = checkCondition(line);-
118 if (condition
conditionDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
) {
0-12
119 if (!function.size()
!function.size()Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
) {
0-12
120 ignoreAll = true;-
121 }
never executed: end of block
else {
0
122 if (!ignoredTests
!ignoredTestsDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
)
2-10
123 ignoredTests = new std::set<QByteArray>;
executed 2 times by 1 test: ignoredTests = new std::set<QByteArray>;
Executed by:
  • tst_selftests - unknown status
2
124 ignoredTests->insert(function);-
125 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
12
126 }-
127 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
12
128}
executed 2 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
2
129-
130void parseGpuBlackList()-
131{-
132 if (!qgpu_features_ptr
!qgpu_features_ptrDescription
TRUEevaluated 790 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
)
25-790
133 return;
executed 790 times by 1 test: return;
Executed by:
  • tst_selftests - unknown status
790
134 QString filename = QTest::qFindTestData(([]() -> QString { enum { Size = sizeof(u"" "GPU_BLACKLIST")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "GPU_BLACKLIST" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 25 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_selftests - unknown status
qstring_literal_temp;
executed 25 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_selftests - unknown status
}()));
25
135 if (filename.isEmpty()
filename.isEmpty()Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
)
0-25
136 return;
executed 25 times by 1 test: return;
Executed by:
  • tst_selftests - unknown status
25
137 if (!gpuFeatures
!gpuFeaturesDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
138 gpuFeatures = qgpu_features_ptr(filename);
never executed: gpuFeatures = qgpu_features_ptr(filename);
0
139}
never executed: end of block
0
140-
141void checkBlackLists(const char *slot, const char *data)-
142{-
143 bool ignore = ignoreAll;-
144-
145 if (!ignore
!ignoreDescription
TRUEevaluated 126139 times by 501 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • ...
FALSEevaluated 471 times by 1 test
Evaluated by:
  • tst_QSslKey
&& ignoredTests
ignoredTestsDescription
TRUEevaluated 3550 times by 24 tests
Evaluated by:
  • tst_QAction
  • tst_QActionGroup
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QFtp
  • tst_QGestureRecognizer
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSemaphore
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTcpServer
  • tst_QTextDocumentLayout
  • tst_QTouchEvent
  • tst_QUdpSocket
  • tst_QWidget
  • tst_Spdy
  • tst_selftests - unknown status
FALSEevaluated 122589 times by 478 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QArrayData
  • ...
) {
471-126139
146 QByteArray s = slot;-
147 ignore = (ignoredTests->find(s) != ignoredTests->end());-
148 if (!ignore
!ignoreDescription
TRUEevaluated 3480 times by 22 tests
Evaluated by:
  • tst_QAction
  • tst_QActionGroup
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QFtp
  • tst_QGestureRecognizer
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSemaphore
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTextDocumentLayout
  • tst_QTouchEvent
  • tst_QUdpSocket
  • tst_QWidget
  • tst_Spdy
FALSEevaluated 70 times by 19 tests
Evaluated by:
  • tst_QAction
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSemaphore
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTcpServer
  • tst_QTextDocumentLayout
  • tst_QTouchEvent
  • tst_QUdpSocket
  • tst_QWidget
  • tst_Spdy
  • tst_selftests - unknown status
&& data
dataDescription
TRUEevaluated 2665 times by 18 tests
Evaluated by:
  • tst_QAction
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QFtp
  • tst_QGestureRecognizer
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QWidget
  • tst_Spdy
FALSEevaluated 815 times by 21 tests
Evaluated by:
  • tst_QAction
  • tst_QActionGroup
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QFtp
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSemaphore
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QTextDocumentLayout
  • tst_QTouchEvent
  • tst_QUdpSocket
  • tst_QWidget
  • tst_Spdy
) {
70-3480
149 s += ':';-
150 s += data;-
151 ignore = (ignoredTests->find(s) != ignoredTests->end());-
152 }
executed 2665 times by 18 tests: end of block
Executed by:
  • tst_QAction
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QFtp
  • tst_QGestureRecognizer
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QTcpServer
  • tst_QUdpSocket
  • tst_QWidget
  • tst_Spdy
2665
153 }
executed 3550 times by 24 tests: end of block
Executed by:
  • tst_QAction
  • tst_QActionGroup
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QFtp
  • tst_QGestureRecognizer
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSemaphore
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslSocket
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTcpServer
  • tst_QTextDocumentLayout
  • tst_QTouchEvent
  • tst_QUdpSocket
  • tst_QWidget
  • tst_Spdy
  • tst_selftests - unknown status
3550
154-
155 QTestResult::setBlacklistCurrentTest(ignore);-
156-
157-
158-
159 if (!ignore
!ignoreDescription
TRUEevaluated 126061 times by 500 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • ...
FALSEevaluated 549 times by 23 tests
Evaluated by:
  • tst_QAction
  • tst_QCompleter
  • tst_QDBusAbstractAdaptor
  • tst_QFtp
  • tst_QGestureRecognizer
  • tst_QGraphicsView
  • tst_QMdiArea
  • tst_QNetworkInterface
  • tst_QNetworkReply
  • tst_QPauseAnimation
  • tst_QSemaphore
  • tst_QSizeGrip
  • tst_QSocks5SocketEngine
  • tst_QSslCertificate
  • tst_QSslKey
  • tst_QSslSocket_onDemandCertificates_member
  • tst_QTcpServer
  • tst_QTextDocumentLayout
  • tst_QTouchEvent
  • tst_QUdpSocket
  • tst_QWidget
  • tst_Spdy
  • tst_selftests - unknown status
&& gpuFeatures
gpuFeaturesDescription
TRUEnever evaluated
FALSEevaluated 126061 times by 500 tests
Evaluated by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • ...
) {
0-126061
160 QByteArray s_gpu = slot;-
161 ignore = isGPUTestBlacklisted(s_gpu, data);-
162 if (!ignore
!ignoreDescription
TRUEnever evaluated
FALSEnever evaluated
&& data
dataDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
163 s_gpu += ':';-
164 s_gpu += data;-
165 isGPUTestBlacklisted(s_gpu);-
166 }
never executed: end of block
0
167 }
never executed: end of block
0
168}
executed 126610 times by 502 tests: end of block
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • ...
126610
169-
170}-
171-
172-
173-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9