| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/testlib/qxunittestlogger.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | QXunitTestLogger::QXunitTestLogger(const char *filename) | - | ||||||||||||||||||||||||
| 7 | : QAbstractTestLogger(filename) | - | ||||||||||||||||||||||||
| 8 | , listOfTestcases(0) | - | ||||||||||||||||||||||||
| 9 | , currentLogElement(0) | - | ||||||||||||||||||||||||
| 10 | , errorLogElement(0) | - | ||||||||||||||||||||||||
| 11 | , logFormatter(0) | - | ||||||||||||||||||||||||
| 12 | , testCounter(0) | - | ||||||||||||||||||||||||
| 13 | , failureCounter(0) | - | ||||||||||||||||||||||||
| 14 | , errorCounter(0) | - | ||||||||||||||||||||||||
| 15 | { | - | ||||||||||||||||||||||||
| 16 | } executed 215 times by 1 test: end of blockExecuted by:
| 215 | ||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||
| 18 | QXunitTestLogger::~QXunitTestLogger() | - | ||||||||||||||||||||||||
| 19 | { | - | ||||||||||||||||||||||||
| 20 | delete currentLogElement; | - | ||||||||||||||||||||||||
| 21 | delete logFormatter; | - | ||||||||||||||||||||||||
| 22 | } executed 215 times by 1 test: end of blockExecuted by:
| 215 | ||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||
| 24 | void QXunitTestLogger::startLogging() | - | ||||||||||||||||||||||||
| 25 | { | - | ||||||||||||||||||||||||
| 26 | QAbstractTestLogger::startLogging(); | - | ||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||
| 28 | logFormatter = new QTestXunitStreamer(this); | - | ||||||||||||||||||||||||
| 29 | delete errorLogElement; | - | ||||||||||||||||||||||||
| 30 | errorLogElement = new QTestElement(QTest::LET_SystemError); | - | ||||||||||||||||||||||||
| 31 | } executed 215 times by 1 test: end of blockExecuted by:
| 215 | ||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||
| 33 | void QXunitTestLogger::stopLogging() | - | ||||||||||||||||||||||||
| 34 | { | - | ||||||||||||||||||||||||
| 35 | QTestElement *iterator = listOfTestcases; | - | ||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | char buf[10]; | - | ||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||
| 39 | currentLogElement = new QTestElement(QTest::LET_TestSuite); | - | ||||||||||||||||||||||||
| 40 | currentLogElement->addAttribute(QTest::AI_Name, QTestResult::currentTestObjectName()); | - | ||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | qsnprintf(buf, sizeof(buf), "%i", testCounter); | - | ||||||||||||||||||||||||
| 43 | currentLogElement->addAttribute(QTest::AI_Tests, buf); | - | ||||||||||||||||||||||||
| 44 | - | |||||||||||||||||||||||||
| 45 | qsnprintf(buf, sizeof(buf), "%i", failureCounter); | - | ||||||||||||||||||||||||
| 46 | currentLogElement->addAttribute(QTest::AI_Failures, buf); | - | ||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||
| 48 | qsnprintf(buf, sizeof(buf), "%i", errorCounter); | - | ||||||||||||||||||||||||
| 49 | currentLogElement->addAttribute(QTest::AI_Errors, buf); | - | ||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||
| 51 | QTestElement *property; | - | ||||||||||||||||||||||||
| 52 | QTestElement *properties = new QTestElement(QTest::LET_Properties); | - | ||||||||||||||||||||||||
| 53 | - | |||||||||||||||||||||||||
| 54 | property = new QTestElement(QTest::LET_Property); | - | ||||||||||||||||||||||||
| 55 | property->addAttribute(QTest::AI_Name, "QTestVersion"); | - | ||||||||||||||||||||||||
| 56 | property->addAttribute(QTest::AI_PropertyValue, "5.7.1"); | - | ||||||||||||||||||||||||
| 57 | properties->addLogElement(property); | - | ||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||
| 59 | property = new QTestElement(QTest::LET_Property); | - | ||||||||||||||||||||||||
| 60 | property->addAttribute(QTest::AI_Name, "QtVersion"); | - | ||||||||||||||||||||||||
| 61 | property->addAttribute(QTest::AI_PropertyValue, qVersion()); | - | ||||||||||||||||||||||||
| 62 | properties->addLogElement(property); | - | ||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||
| 64 | property = new QTestElement(QTest::LET_Property); | - | ||||||||||||||||||||||||
| 65 | property->addAttribute(QTest::AI_Name, "QtBuild"); | - | ||||||||||||||||||||||||
| 66 | property->addAttribute(QTest::AI_PropertyValue, QLibraryInfo::build()); | - | ||||||||||||||||||||||||
| 67 | properties->addLogElement(property); | - | ||||||||||||||||||||||||
| 68 | - | |||||||||||||||||||||||||
| 69 | currentLogElement->addLogElement(properties); | - | ||||||||||||||||||||||||
| 70 | - | |||||||||||||||||||||||||
| 71 | currentLogElement->addLogElement(iterator); | - | ||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | QTestElement* testcase = iterator; | - | ||||||||||||||||||||||||
| 75 | while (testcase
| 215-1540 | ||||||||||||||||||||||||
| 76 | testcase->setParent(currentLogElement); | - | ||||||||||||||||||||||||
| 77 | testcase = testcase->nextElement(); | - | ||||||||||||||||||||||||
| 78 | } executed 1540 times by 1 test: end of blockExecuted by:
| 1540 | ||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | currentLogElement->addLogElement(errorLogElement); | - | ||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||
| 82 | QTestElement *it = currentLogElement; | - | ||||||||||||||||||||||||
| 83 | logFormatter->output(it); | - | ||||||||||||||||||||||||
| 84 | - | |||||||||||||||||||||||||
| 85 | QAbstractTestLogger::stopLogging(); | - | ||||||||||||||||||||||||
| 86 | } executed 215 times by 1 test: end of blockExecuted by:
| 215 | ||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | void QXunitTestLogger::enterTestFunction(const char *function) | - | ||||||||||||||||||||||||
| 89 | { | - | ||||||||||||||||||||||||
| 90 | currentLogElement = new QTestElement(QTest::LET_TestCase); | - | ||||||||||||||||||||||||
| 91 | currentLogElement->addAttribute(QTest::AI_Name, function); | - | ||||||||||||||||||||||||
| 92 | currentLogElement->addToList(&listOfTestcases); | - | ||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||
| 94 | ++testCounter; | - | ||||||||||||||||||||||||
| 95 | } executed 1325 times by 1 test: end of blockExecuted by:
| 1325 | ||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||
| 97 | void QXunitTestLogger::leaveTestFunction() | - | ||||||||||||||||||||||||
| 98 | { | - | ||||||||||||||||||||||||
| 99 | } | - | ||||||||||||||||||||||||
| 100 | - | |||||||||||||||||||||||||
| 101 | void QXunitTestLogger::addIncident(IncidentTypes type, const char *description, | - | ||||||||||||||||||||||||
| 102 | const char *file, int line) | - | ||||||||||||||||||||||||
| 103 | { | - | ||||||||||||||||||||||||
| 104 | const char *typeBuf = 0; | - | ||||||||||||||||||||||||
| 105 | char buf[100]; | - | ||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||
| 107 | switch (type) { | - | ||||||||||||||||||||||||
| 108 | case executed 28 times by 1 test: QAbstractTestLogger::XPass:case QAbstractTestLogger::XPass:Executed by:
executed 28 times by 1 test: case QAbstractTestLogger::XPass:Executed by:
| 28 | ||||||||||||||||||||||||
| 109 | ++failureCounter; | - | ||||||||||||||||||||||||
| 110 | typeBuf = "xpass"; | - | ||||||||||||||||||||||||
| 111 | break; executed 28 times by 1 test: break;Executed by:
| 28 | ||||||||||||||||||||||||
| 112 | case executed 1308 times by 1 test: QAbstractTestLogger::Pass:case QAbstractTestLogger::Pass:Executed by:
executed 1308 times by 1 test: case QAbstractTestLogger::Pass:Executed by:
| 1308 | ||||||||||||||||||||||||
| 113 | typeBuf = "pass"; | - | ||||||||||||||||||||||||
| 114 | break; executed 1308 times by 1 test: break;Executed by:
| 1308 | ||||||||||||||||||||||||
| 115 | case executed 105 times by 1 test: QAbstractTestLogger::XFail:case QAbstractTestLogger::XFail:Executed by:
executed 105 times by 1 test: case QAbstractTestLogger::XFail:Executed by:
| 105 | ||||||||||||||||||||||||
| 116 | typeBuf = "xfail"; | - | ||||||||||||||||||||||||
| 117 | break; executed 105 times by 1 test: break;Executed by:
| 105 | ||||||||||||||||||||||||
| 118 | case executed 725 times by 1 test: QAbstractTestLogger::Fail:case QAbstractTestLogger::Fail:Executed by:
executed 725 times by 1 test: case QAbstractTestLogger::Fail:Executed by:
| 725 | ||||||||||||||||||||||||
| 119 | ++failureCounter; | - | ||||||||||||||||||||||||
| 120 | typeBuf = "fail"; | - | ||||||||||||||||||||||||
| 121 | break; executed 725 times by 1 test: break;Executed by:
| 725 | ||||||||||||||||||||||||
| 122 | case never executed: QAbstractTestLogger::BlacklistedPass:case QAbstractTestLogger::BlacklistedPass:never executed: case QAbstractTestLogger::BlacklistedPass: | 0 | ||||||||||||||||||||||||
| 123 | typeBuf = "bpass"; | - | ||||||||||||||||||||||||
| 124 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 125 | case never executed: QAbstractTestLogger::BlacklistedFail:case QAbstractTestLogger::BlacklistedFail:never executed: case QAbstractTestLogger::BlacklistedFail: | 0 | ||||||||||||||||||||||||
| 126 | ++failureCounter; | - | ||||||||||||||||||||||||
| 127 | typeBuf = "bfail"; | - | ||||||||||||||||||||||||
| 128 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 129 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 130 | typeBuf = "??????"; | - | ||||||||||||||||||||||||
| 131 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 132 | } | - | ||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||
| 134 | if (type == QAbstractTestLogger::Fail
| 28-1441 | ||||||||||||||||||||||||
| 135 | QTestElement *failureElement = new QTestElement(QTest::LET_Failure); | - | ||||||||||||||||||||||||
| 136 | failureElement->addAttribute(QTest::AI_Result, typeBuf); | - | ||||||||||||||||||||||||
| 137 | if (file
| 47-706 | ||||||||||||||||||||||||
| 138 | failureElement->addAttribute(QTest::AI_File, file); executed 706 times by 1 test: failureElement->addAttribute(QTest::AI_File, file);Executed by:
| 706 | ||||||||||||||||||||||||
| 139 | else | - | ||||||||||||||||||||||||
| 140 | failureElement->addAttribute(QTest::AI_File, ""); executed 47 times by 1 test: failureElement->addAttribute(QTest::AI_File, "");Executed by:
| 47 | ||||||||||||||||||||||||
| 141 | qsnprintf(buf, sizeof(buf), "%i", line); | - | ||||||||||||||||||||||||
| 142 | failureElement->addAttribute(QTest::AI_Line, buf); | - | ||||||||||||||||||||||||
| 143 | failureElement->addAttribute(QTest::AI_Description, description); | - | ||||||||||||||||||||||||
| 144 | addTag(failureElement); | - | ||||||||||||||||||||||||
| 145 | currentLogElement->addLogElement(failureElement); | - | ||||||||||||||||||||||||
| 146 | } executed 753 times by 1 test: end of blockExecuted by:
| 753 | ||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||
| 148 | - | |||||||||||||||||||||||||
| 149 | - | |||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||
| 153 | QTestElementAttribute* resultAttr = | - | ||||||||||||||||||||||||
| 154 | const_cast<QTestElementAttribute*>(currentLogElement->attribute(QTest::AI_Result)); | - | ||||||||||||||||||||||||
| 155 | if (resultAttr
| 932-1234 | ||||||||||||||||||||||||
| 156 | const char* oldResult = resultAttr->value(); | - | ||||||||||||||||||||||||
| 157 | bool overwrite = false; | - | ||||||||||||||||||||||||
| 158 | if (!strcmp(oldResult, "pass")
| 407-525 | ||||||||||||||||||||||||
| 159 | overwrite = true; | - | ||||||||||||||||||||||||
| 160 | } executed 407 times by 1 test: end of blockExecuted by:
| 407 | ||||||||||||||||||||||||
| 161 | else if (!strcmp(oldResult, "bpass")
| 0-525 | ||||||||||||||||||||||||
| 162 | overwrite = (type == QAbstractTestLogger::XPass
| 0 | ||||||||||||||||||||||||
| 163 | || (
| 0 | ||||||||||||||||||||||||
| 164 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 165 | else if (!strcmp(oldResult, "bfail")
| 0-525 | ||||||||||||||||||||||||
| 166 | overwrite = (type == QAbstractTestLogger::XPass
| 0 | ||||||||||||||||||||||||
| 167 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 168 | else if (!strcmp(oldResult, "xfail")
| 126-399 | ||||||||||||||||||||||||
| 169 | overwrite = (type == QAbstractTestLogger::XPass
| 0-126 | ||||||||||||||||||||||||
| 170 | } executed 126 times by 1 test: end of blockExecuted by:
| 126 | ||||||||||||||||||||||||
| 171 | else if (!strcmp(oldResult, "xpass")
| 14-385 | ||||||||||||||||||||||||
| 172 | overwrite = (type == QAbstractTestLogger::Fail); | - | ||||||||||||||||||||||||
| 173 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 174 | if (overwrite
| 414-518 | ||||||||||||||||||||||||
| 175 | resultAttr->setPair(QTest::AI_Result, typeBuf); | - | ||||||||||||||||||||||||
| 176 | } executed 414 times by 1 test: end of blockExecuted by:
| 414 | ||||||||||||||||||||||||
| 177 | } executed 932 times by 1 test: end of blockExecuted by:
| 932 | ||||||||||||||||||||||||
| 178 | else { | - | ||||||||||||||||||||||||
| 179 | currentLogElement->addAttribute(QTest::AI_Result, typeBuf); | - | ||||||||||||||||||||||||
| 180 | } executed 1234 times by 1 test: end of blockExecuted by:
| 1234 | ||||||||||||||||||||||||
| 181 | - | |||||||||||||||||||||||||
| 182 | if (file
| 811-1355 | ||||||||||||||||||||||||
| 183 | currentLogElement->addAttribute(QTest::AI_File, file); executed 811 times by 1 test: currentLogElement->addAttribute(QTest::AI_File, file);Executed by:
| 811 | ||||||||||||||||||||||||
| 184 | else | - | ||||||||||||||||||||||||
| 185 | currentLogElement->addAttribute(QTest::AI_File, ""); executed 1355 times by 1 test: currentLogElement->addAttribute(QTest::AI_File, "");Executed by:
| 1355 | ||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||
| 187 | qsnprintf(buf, sizeof(buf), "%i", line); | - | ||||||||||||||||||||||||
| 188 | currentLogElement->addAttribute(QTest::AI_Line, buf); | - | ||||||||||||||||||||||||
| 189 | - | |||||||||||||||||||||||||
| 190 | - | |||||||||||||||||||||||||
| 191 | - | |||||||||||||||||||||||||
| 192 | - | |||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||
| 194 | if (type == QAbstractTestLogger::XFail
| 105-2061 | ||||||||||||||||||||||||
| 195 | QXunitTestLogger::addMessage(QAbstractTestLogger::Info, QString::fromUtf8(description), file, line); | - | ||||||||||||||||||||||||
| 196 | } executed 105 times by 1 test: end of blockExecuted by:
| 105 | ||||||||||||||||||||||||
| 197 | } executed 2166 times by 1 test: end of blockExecuted by:
| 2166 | ||||||||||||||||||||||||
| 198 | - | |||||||||||||||||||||||||
| 199 | void QXunitTestLogger::addBenchmarkResult(const QBenchmarkResult &result) | - | ||||||||||||||||||||||||
| 200 | { | - | ||||||||||||||||||||||||
| 201 | QTestElement *benchmarkElement = new QTestElement(QTest::LET_Benchmark); | - | ||||||||||||||||||||||||
| 202 | - | |||||||||||||||||||||||||
| 203 | benchmarkElement->addAttribute( | - | ||||||||||||||||||||||||
| 204 | QTest::AI_Metric, | - | ||||||||||||||||||||||||
| 205 | QTest::benchmarkMetricName(QBenchmarkTestMethodData::current->result.metric)); | - | ||||||||||||||||||||||||
| 206 | benchmarkElement->addAttribute(QTest::AI_Tag, result.context.tag.toUtf8().data()); | - | ||||||||||||||||||||||||
| 207 | - | |||||||||||||||||||||||||
| 208 | const qreal valuePerIteration = qreal(result.value) / qreal(result.iterations); | - | ||||||||||||||||||||||||
| 209 | benchmarkElement->addAttribute(QTest::AI_Value, QByteArray::number(valuePerIteration).constData()); | - | ||||||||||||||||||||||||
| 210 | - | |||||||||||||||||||||||||
| 211 | char buf[100]; | - | ||||||||||||||||||||||||
| 212 | qsnprintf(buf, sizeof(buf), "%i", result.iterations); | - | ||||||||||||||||||||||||
| 213 | benchmarkElement->addAttribute(QTest::AI_Iterations, buf); | - | ||||||||||||||||||||||||
| 214 | currentLogElement->addLogElement(benchmarkElement); | - | ||||||||||||||||||||||||
| 215 | } executed 76 times by 1 test: end of blockExecuted by:
| 76 | ||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | void QXunitTestLogger::addTag(QTestElement* element) | - | ||||||||||||||||||||||||
| 218 | { | - | ||||||||||||||||||||||||
| 219 | const char *tag = QTestResult::currentDataTag(); | - | ||||||||||||||||||||||||
| 220 | const char *gtag = QTestResult::currentGlobalDataTag(); | - | ||||||||||||||||||||||||
| 221 | const char *filler = (tag
| 238-14619 | ||||||||||||||||||||||||
| 222 | if ((!tag
| 0-14619 | ||||||||||||||||||||||||
| 223 | return; executed 14612 times by 1 test: return;Executed by:
| 14612 | ||||||||||||||||||||||||
| 224 | } | - | ||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 | if (!tag
| 7-1417 | ||||||||||||||||||||||||
| 227 | tag = ""; | - | ||||||||||||||||||||||||
| 228 | } executed 7 times by 1 test: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||
| 229 | if (!gtag
| 245-1179 | ||||||||||||||||||||||||
| 230 | gtag = ""; | - | ||||||||||||||||||||||||
| 231 | } executed 1179 times by 1 test: end of blockExecuted by:
| 1179 | ||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||
| 233 | QTestCharBuffer buf; | - | ||||||||||||||||||||||||
| 234 | QTest::qt_asprintf(&buf, "%s%s%s", gtag, filler, tag); | - | ||||||||||||||||||||||||
| 235 | element->addAttribute(QTest::AI_Tag, buf.constData()); | - | ||||||||||||||||||||||||
| 236 | } executed 1424 times by 1 test: end of blockExecuted by:
| 1424 | ||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||
| 238 | void QXunitTestLogger::addMessage(MessageTypes type, const QString &message, const char *file, int line) | - | ||||||||||||||||||||||||
| 239 | { | - | ||||||||||||||||||||||||
| 240 | QTestElement *errorElement = new QTestElement(QTest::LET_Error); | - | ||||||||||||||||||||||||
| 241 | const char *typeBuf = 0; | - | ||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||
| 243 | switch (type) { | - | ||||||||||||||||||||||||
| 244 | case executed 14 times by 1 test: QAbstractTestLogger::Warn:case QAbstractTestLogger::Warn:Executed by:
executed 14 times by 1 test: case QAbstractTestLogger::Warn:Executed by:
| 14 | ||||||||||||||||||||||||
| 245 | typeBuf = "warn"; | - | ||||||||||||||||||||||||
| 246 | break; executed 14 times by 1 test: break;Executed by:
| 14 | ||||||||||||||||||||||||
| 247 | case executed 7 times by 1 test: QAbstractTestLogger::QSystem:case QAbstractTestLogger::QSystem:Executed by:
executed 7 times by 1 test: case QAbstractTestLogger::QSystem:Executed by:
| 7 | ||||||||||||||||||||||||
| 248 | typeBuf = "system"; | - | ||||||||||||||||||||||||
| 249 | break; executed 7 times by 1 test: break;Executed by:
| 7 | ||||||||||||||||||||||||
| 250 | case executed 625 times by 1 test: QAbstractTestLogger::QDebug:case QAbstractTestLogger::QDebug:Executed by:
executed 625 times by 1 test: case QAbstractTestLogger::QDebug:Executed by:
| 625 | ||||||||||||||||||||||||
| 251 | typeBuf = "qdebug"; | - | ||||||||||||||||||||||||
| 252 | break; executed 625 times by 1 test: break;Executed by:
| 625 | ||||||||||||||||||||||||
| 253 | case executed 14 times by 1 test: QAbstractTestLogger::QInfo:case QAbstractTestLogger::QInfo:Executed by:
executed 14 times by 1 test: case QAbstractTestLogger::QInfo:Executed by:
| 14 | ||||||||||||||||||||||||
| 254 | typeBuf = "qinfo"; | - | ||||||||||||||||||||||||
| 255 | break; executed 14 times by 1 test: break;Executed by:
| 14 | ||||||||||||||||||||||||
| 256 | case executed 14028 times by 1 test: QAbstractTestLogger::QWarning:case QAbstractTestLogger::QWarning:Executed by:
executed 14028 times by 1 test: case QAbstractTestLogger::QWarning:Executed by:
| 14028 | ||||||||||||||||||||||||
| 257 | typeBuf = "qwarn"; | - | ||||||||||||||||||||||||
| 258 | break; executed 14028 times by 1 test: break;Executed by:
| 14028 | ||||||||||||||||||||||||
| 259 | case executed 14 times by 1 test: QAbstractTestLogger::QFatal:case QAbstractTestLogger::QFatal:Executed by:
executed 14 times by 1 test: case QAbstractTestLogger::QFatal:Executed by:
| 14 | ||||||||||||||||||||||||
| 260 | typeBuf = "qfatal"; | - | ||||||||||||||||||||||||
| 261 | break; executed 14 times by 1 test: break;Executed by:
| 14 | ||||||||||||||||||||||||
| 262 | case executed 259 times by 1 test: QAbstractTestLogger::Skip:case QAbstractTestLogger::Skip:Executed by:
executed 259 times by 1 test: case QAbstractTestLogger::Skip:Executed by:
| 259 | ||||||||||||||||||||||||
| 263 | typeBuf = "skip"; | - | ||||||||||||||||||||||||
| 264 | break; executed 259 times by 1 test: break;Executed by:
| 259 | ||||||||||||||||||||||||
| 265 | case executed 322 times by 1 test: QAbstractTestLogger::Info:case QAbstractTestLogger::Info:Executed by:
executed 322 times by 1 test: case QAbstractTestLogger::Info:Executed by:
| 322 | ||||||||||||||||||||||||
| 266 | typeBuf = "info"; | - | ||||||||||||||||||||||||
| 267 | break; executed 322 times by 1 test: break;Executed by:
| 322 | ||||||||||||||||||||||||
| 268 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||
| 269 | typeBuf = "??????"; | - | ||||||||||||||||||||||||
| 270 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 271 | } | - | ||||||||||||||||||||||||
| 272 | - | |||||||||||||||||||||||||
| 273 | errorElement->addAttribute(QTest::AI_Type, typeBuf); | - | ||||||||||||||||||||||||
| 274 | errorElement->addAttribute(QTest::AI_Description, message.toUtf8().constData()); | - | ||||||||||||||||||||||||
| 275 | addTag(errorElement); | - | ||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||
| 277 | if (file
| 546-14737 | ||||||||||||||||||||||||
| 278 | errorElement->addAttribute(QTest::AI_File, file); executed 546 times by 1 test: errorElement->addAttribute(QTest::AI_File, file);Executed by:
| 546 | ||||||||||||||||||||||||
| 279 | else | - | ||||||||||||||||||||||||
| 280 | errorElement->addAttribute(QTest::AI_File, ""); executed 14737 times by 1 test: errorElement->addAttribute(QTest::AI_File, "");Executed by:
| 14737 | ||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||
| 282 | char buf[100]; | - | ||||||||||||||||||||||||
| 283 | qsnprintf(buf, sizeof(buf), "%i", line); | - | ||||||||||||||||||||||||
| 284 | errorElement->addAttribute(QTest::AI_Line, buf); | - | ||||||||||||||||||||||||
| 285 | - | |||||||||||||||||||||||||
| 286 | currentLogElement->addLogElement(errorElement); | - | ||||||||||||||||||||||||
| 287 | ++errorCounter; | - | ||||||||||||||||||||||||
| 288 | - | |||||||||||||||||||||||||
| 289 | - | |||||||||||||||||||||||||
| 290 | if (errorLogElement
| 0-15283 | ||||||||||||||||||||||||
| 291 | QTestElement *systemErrorElement = new QTestElement(QTest::LET_Error); | - | ||||||||||||||||||||||||
| 292 | systemErrorElement->addAttribute(QTest::AI_Description, message.toUtf8().constData()); | - | ||||||||||||||||||||||||
| 293 | errorLogElement->addLogElement(systemErrorElement); | - | ||||||||||||||||||||||||
| 294 | } executed 15283 times by 1 test: end of blockExecuted by:
| 15283 | ||||||||||||||||||||||||
| 295 | } executed 15283 times by 1 test: end of blockExecuted by:
| 15283 | ||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |