Lines Matching full:log

244 static void qpTestLog_flushFile(qpTestLog *log)  in qpTestLog_flushFile()  argument
246 DE_ASSERT(log && log->outputFile); in qpTestLog_flushFile()
247 fflush(log->outputFile); in qpTestLog_flushFile()
250 FlushFileBuffers((HANDLE)_get_osfhandle(_fileno(log->outputFile))); in qpTestLog_flushFile()
287 static bool endSession(qpTestLog *log) in endSession() argument
289 DE_ASSERT(log && log->isSessionOpen); in endSession()
292 qpXmlWriter_flush(log->writer); in endSession()
296 fprintf(log->outputFile, "\nRun took %.2f seconds\n", (float)duration / 1000000.0f); in endSession()
299 fprintf(log->outputFile, "\n#endSession\n"); in endSession()
300 qpTestLog_flushFile(log); in endSession()
302 log->isSessionOpen = false; in endSession()
314 qpTestLog *log = (qpTestLog *)deCalloc(sizeof(qpTestLog)); in qpTestLog_createFileLog() local
315 if (!log) in qpTestLog_createFileLog()
321 ContainerStack_reset(&log->containerStack); in qpTestLog_createFileLog()
325 qpPrintf("Writing test log into %s\n", fileName); in qpTestLog_createFileLog()
328 log->outputFile = fopen(fileName, "wb"); in qpTestLog_createFileLog()
329 if (!log->outputFile) in qpTestLog_createFileLog()
331 qpPrintf("ERROR: Unable to open test log output file '%s'.\n", fileName); in qpTestLog_createFileLog()
332 qpTestLog_destroy(log); in qpTestLog_createFileLog()
336 log->flags = flags; in qpTestLog_createFileLog()
337log->writer = qpXmlWriter_createFileWriter(log->outputFile, 0, !(flags & QP_TEST_LOG_NO_FLU… in qpTestLog_createFileLog()
338 log->lock = deMutex_create(DE_NULL); in qpTestLog_createFileLog()
339 log->isSessionOpen = false; in qpTestLog_createFileLog()
340 log->isCaseOpen = false; in qpTestLog_createFileLog()
342 if (!log->writer) in qpTestLog_createFileLog()
345 qpTestLog_destroy(log); in qpTestLog_createFileLog()
349 if (!log->lock) in qpTestLog_createFileLog()
352 qpTestLog_destroy(log); in qpTestLog_createFileLog()
356 return log; in qpTestLog_createFileLog()
360 * \brief Log information about test session
361 * \param log qpTestLog instance
364 bool qpTestLog_beginSession(qpTestLog *log, const char *additionalSessionInfo) in qpTestLog_beginSession() argument
366 DE_ASSERT(log); in qpTestLog_beginSession()
369 if (log->isSessionOpen) in qpTestLog_beginSession()
373 fprintf(log->outputFile, "#sessionInfo releaseName %s\n", qpGetReleaseName()); in qpTestLog_beginSession()
374 fprintf(log->outputFile, "#sessionInfo releaseId 0x%08x\n", qpGetReleaseId()); in qpTestLog_beginSession()
375 fprintf(log->outputFile, "#sessionInfo targetName \"%s\"\n", qpGetTargetName()); in qpTestLog_beginSession()
377 if (qpTestLog_isCompact(log)) in qpTestLog_beginSession()
381 …fprintf(log->outputFile, "#sessionInfo logFormatVersion \"%s%s\"\n", LOG_FORMAT_VERSION, compactSt… in qpTestLog_beginSession()
384 fprintf(log->outputFile, "%s\n", additionalSessionInfo); in qpTestLog_beginSession()
387 fprintf(log->outputFile, "#beginSession\n"); in qpTestLog_beginSession()
388 qpTestLog_flushFile(log); in qpTestLog_beginSession()
391 log->isSessionOpen = true; in qpTestLog_beginSession()
398 * \param log qpTestLog instance
400 void qpTestLog_destroy(qpTestLog *log) in qpTestLog_destroy() argument
402 DE_ASSERT(log); in qpTestLog_destroy()
404 if (log->isSessionOpen) in qpTestLog_destroy()
405 endSession(log); in qpTestLog_destroy()
407 if (log->writer) in qpTestLog_destroy()
408 qpXmlWriter_destroy(log->writer); in qpTestLog_destroy()
410 if (log->outputFile) in qpTestLog_destroy()
411 fclose(log->outputFile); in qpTestLog_destroy()
413 if (log->lock) in qpTestLog_destroy()
414 deMutex_destroy(log->lock); in qpTestLog_destroy()
416 deFree(log); in qpTestLog_destroy()
420 * \brief Log start of test case
421 * \param log qpTestLog instance
426 bool qpTestLog_startCase(qpTestLog *log, const char *testCasePath, qpTestCaseType testCaseType) in qpTestLog_startCase() argument
432 DE_ASSERT(log && testCasePath && (testCasePath[0] != 0)); in qpTestLog_startCase()
433 deMutex_lock(log->lock); in qpTestLog_startCase()
435 DE_ASSERT(!log->isCaseOpen); in qpTestLog_startCase()
436 DE_ASSERT(ContainerStack_isEmpty(&log->containerStack)); in qpTestLog_startCase()
439 qpXmlWriter_flush(log->writer); in qpTestLog_startCase()
440 if (!qpTestLog_isCompact(log)) in qpTestLog_startCase()
442 fprintf(log->outputFile, "\n#beginTestCaseResult %s\n", testCasePath); in qpTestLog_startCase()
444 if (!(log->flags & QP_TEST_LOG_NO_FLUSH)) in qpTestLog_startCase()
445 qpTestLog_flushFile(log); in qpTestLog_startCase()
447 log->isCaseOpen = true; in qpTestLog_startCase()
451 if (!qpTestLog_isCompact(log)) in qpTestLog_startCase()
457 if (!qpXmlWriter_startDocument(log->writer, !qpTestLog_isCompact(log)) || in qpTestLog_startCase()
458 !qpXmlWriter_startElement(log->writer, "TestCaseResult", numResultAttribs, resultAttribs)) in qpTestLog_startCase()
461 deMutex_unlock(log->lock); in qpTestLog_startCase()
465 deMutex_unlock(log->lock); in qpTestLog_startCase()
470 * \brief Log end of test case
471 * \param log qpTestLog instance
476 bool qpTestLog_endCase(qpTestLog *log, qpTestResult result, const char *resultDetails) in qpTestLog_endCase() argument
481 deMutex_lock(log->lock); in qpTestLog_endCase()
483 DE_ASSERT(log->isCaseOpen); in qpTestLog_endCase()
484 DE_ASSERT(ContainerStack_isEmpty(&log->containerStack)); in qpTestLog_endCase()
489 if (!qpXmlWriter_startElement(log->writer, "Result", 1, &statusAttrib) || in qpTestLog_endCase()
490 (resultDetails && !qpXmlWriter_writeString(log->writer, resultDetails)) || in qpTestLog_endCase()
491 …!qpXmlWriter_endElement(log->writer, "Result") || !qpXmlWriter_endElement(log->writer, "TestCaseRe… in qpTestLog_endCase()
492 !qpXmlWriter_endDocument(log->writer)) /* Close any XML elements still open */ in qpTestLog_endCase()
495 deMutex_unlock(log->lock); in qpTestLog_endCase()
500 qpXmlWriter_flush(log->writer); in qpTestLog_endCase()
501 if (!qpTestLog_isCompact(log)) in qpTestLog_endCase()
503 fprintf(log->outputFile, "\n#endTestCaseResult\n"); in qpTestLog_endCase()
505 if (!(log->flags & QP_TEST_LOG_NO_FLUSH)) in qpTestLog_endCase()
506 qpTestLog_flushFile(log); in qpTestLog_endCase()
508 log->isCaseOpen = false; in qpTestLog_endCase()
510 deMutex_unlock(log->lock); in qpTestLog_endCase()
514 bool qpTestLog_startTestsCasesTime(qpTestLog *log) in qpTestLog_startTestsCasesTime() argument
516 DE_ASSERT(log); in qpTestLog_startTestsCasesTime()
517 deMutex_lock(log->lock); in qpTestLog_startTestsCasesTime()
520 qpXmlWriter_flush(log->writer); in qpTestLog_startTestsCasesTime()
521 fprintf(log->outputFile, "\n#beginTestsCasesTime\n"); in qpTestLog_startTestsCasesTime()
523 log->isCaseOpen = true; in qpTestLog_startTestsCasesTime()
525 if (!qpXmlWriter_startDocument(log->writer, !qpTestLog_isCompact(log)) || in qpTestLog_startTestsCasesTime()
526 … !qpXmlWriter_startElement(log->writer, "TestsCasesTime", 0, (const qpXmlAttribute *)DE_NULL)) in qpTestLog_startTestsCasesTime()
529 deMutex_unlock(log->lock); in qpTestLog_startTestsCasesTime()
533 deMutex_unlock(log->lock); in qpTestLog_startTestsCasesTime()
537 bool qpTestLog_endTestsCasesTime(qpTestLog *log) in qpTestLog_endTestsCasesTime() argument
539 DE_ASSERT(log); in qpTestLog_endTestsCasesTime()
540 deMutex_lock(log->lock); in qpTestLog_endTestsCasesTime()
542 DE_ASSERT(log->isCaseOpen); in qpTestLog_endTestsCasesTime()
544 …if (!qpXmlWriter_endElement(log->writer, "TestsCasesTime") || !qpXmlWriter_endDocument(log->writer… in qpTestLog_endTestsCasesTime()
547 deMutex_unlock(log->lock); in qpTestLog_endTestsCasesTime()
551 qpXmlWriter_flush(log->writer); in qpTestLog_endTestsCasesTime()
553 fprintf(log->outputFile, "\n#endTestsCasesTime\n"); in qpTestLog_endTestsCasesTime()
555 log->isCaseOpen = false; in qpTestLog_endTestsCasesTime()
557 deMutex_unlock(log->lock); in qpTestLog_endTestsCasesTime()
563 * \param log qpTestLog instance
567 bool qpTestLog_terminateCase(qpTestLog *log, qpTestResult result) in qpTestLog_terminateCase() argument
571 DE_ASSERT(log); in qpTestLog_terminateCase()
574 deMutex_lock(log->lock); in qpTestLog_terminateCase()
576 if (!log->isCaseOpen) in qpTestLog_terminateCase()
578 deMutex_unlock(log->lock); in qpTestLog_terminateCase()
583 qpXmlWriter_flush(log->writer); in qpTestLog_terminateCase()
584 fprintf(log->outputFile, "\n#terminateTestCaseResult %s\n", resultStr); in qpTestLog_terminateCase()
585 qpTestLog_flushFile(log); in qpTestLog_terminateCase()
587 log->isCaseOpen = false; in qpTestLog_terminateCase()
590 ContainerStack_reset(&log->containerStack); in qpTestLog_terminateCase()
593 deMutex_unlock(log->lock); in qpTestLog_terminateCase()
597 static bool qpTestLog_writeKeyValuePair(qpTestLog *log, const char *elementName, const char *name, in qpTestLog_writeKeyValuePair() argument
604 DE_ASSERT(log && elementName && text); in qpTestLog_writeKeyValuePair()
605 deMutex_lock(log->lock); in qpTestLog_writeKeyValuePair()
617 if (!qpXmlWriter_startElement(log->writer, elementName, numAttribs, attribs) || in qpTestLog_writeKeyValuePair()
618 … !qpXmlWriter_writeString(log->writer, text) || !qpXmlWriter_endElement(log->writer, elementName)) in qpTestLog_writeKeyValuePair()
621 deMutex_unlock(log->lock); in qpTestLog_writeKeyValuePair()
625 deMutex_unlock(log->lock); in qpTestLog_writeKeyValuePair()
630 * \brief Write key-value-pair into log
631 * \param log qpTestLog instance
638 bool qpTestLog_writeText(qpTestLog *log, const char *name, const char *description, qpKeyValueTag t… in qpTestLog_writeText() argument
641 return qpTestLog_writeKeyValuePair(log, "Text", name, description, DE_NULL, tag, text); in qpTestLog_writeText()
645 * \brief Write key-value-pair into log
646 * \param log qpTestLog instance
653 bool qpTestLog_writeInteger(qpTestLog *log, const char *name, const char *description, const char *… in qpTestLog_writeInteger() argument
660 return qpTestLog_writeKeyValuePair(log, "Number", name, description, unit, tag, tmpString); in qpTestLog_writeInteger()
664 * \brief Write key-value-pair into log
665 * \param log qpTestLog instance
672 bool qpTestLog_writeFloat(qpTestLog *log, const char *name, const char *description, const char *un… in qpTestLog_writeFloat() argument
679 return qpTestLog_writeKeyValuePair(log, "Number", name, description, unit, tag, tmpString); in qpTestLog_writeFloat()
817 * \param log qpTestLog instance
822 bool qpTestLog_startImageSet(qpTestLog *log, const char *name, const char *description) in qpTestLog_startImageSet() argument
827 DE_ASSERT(log && name); in qpTestLog_startImageSet()
828 deMutex_lock(log->lock); in qpTestLog_startImageSet()
835 if (!qpXmlWriter_startElement(log->writer, "ImageSet", numAttribs, attribs)) in qpTestLog_startImageSet()
838 deMutex_unlock(log->lock); in qpTestLog_startImageSet()
842 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_IMAGESET)); in qpTestLog_startImageSet()
844 deMutex_unlock(log->lock); in qpTestLog_startImageSet()
850 * \param log qpTestLog instance
853 bool qpTestLog_endImageSet(qpTestLog *log) in qpTestLog_endImageSet() argument
855 DE_ASSERT(log); in qpTestLog_endImageSet()
856 deMutex_lock(log->lock); in qpTestLog_endImageSet()
859 if (!qpXmlWriter_endElement(log->writer, "ImageSet")) in qpTestLog_endImageSet()
862 deMutex_unlock(log->lock); in qpTestLog_endImageSet()
866 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_IMAGESET); in qpTestLog_endImageSet()
868 deMutex_unlock(log->lock); in qpTestLog_endImageSet()
873 * \brief Write base64 encoded raw image data into log
874 * \param log qpTestLog instance
885 bool qpTestLog_writeImage(qpTestLog *log, const char *name, const char *description, in qpTestLog_writeImage() argument
897 DE_ASSERT(log && name); in qpTestLog_writeImage()
902 if (log->flags & QP_TEST_LOG_EXCLUDE_IMAGES) in qpTestLog_writeImage()
993 /* \note Log lock is acquired after compression! */ in qpTestLog_writeImage()
994 deMutex_lock(log->lock); in qpTestLog_writeImage()
997 if (!qpXmlWriter_startElement(log->writer, "Image", numAttribs, attribs) || in qpTestLog_writeImage()
998 !qpXmlWriter_writeBase64(log->writer, (const uint8_t *)writeDataPtr, writeDataBytes) || in qpTestLog_writeImage()
999 !qpXmlWriter_endElement(log->writer, "Image")) in qpTestLog_writeImage()
1002 deMutex_unlock(log->lock); in qpTestLog_writeImage()
1007 deMutex_unlock(log->lock); in qpTestLog_writeImage()
1016 * \brief Writes infoLog into log. Might filter out empty infoLog.
1017 * \param log qpTestLog instance
1018 * \param infoLog Implementation provided shader compilation or linkage log
1021 bool qpTestLog_writeInfoLog(qpTestLog *log, const char *infoLog) in qpTestLog_writeInfoLog() argument
1026 if (infoLog[0] == '\0' && (log->flags & QP_TEST_LOG_EXCLUDE_EMPTY_LOGINFO) != 0) in qpTestLog_writeInfoLog()
1029 return qpXmlWriter_writeStringElement(log->writer, "InfoLog", infoLog); in qpTestLog_writeInfoLog()
1033 * \brief Write a OpenGL ES shader program into the log.
1035 * \param linkInfoLog Implementation provided linkage log
1037 bool qpTestLog_startShaderProgram(qpTestLog *log, bool linkOk, const char *linkInfoLog) in qpTestLog_startShaderProgram() argument
1042 DE_ASSERT(log); in qpTestLog_startShaderProgram()
1043 deMutex_lock(log->lock); in qpTestLog_startShaderProgram()
1047 … if (!qpXmlWriter_startElement(log->writer, "ShaderProgram", numProgramAttribs, programAttribs) || in qpTestLog_startShaderProgram()
1048 !qpTestLog_writeInfoLog(log, linkInfoLog)) in qpTestLog_startShaderProgram()
1051 deMutex_unlock(log->lock); in qpTestLog_startShaderProgram()
1055 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SHADERPROGRAM)); in qpTestLog_startShaderProgram()
1057 deMutex_unlock(log->lock); in qpTestLog_startShaderProgram()
1063 * \param log qpTestLog instance
1066 bool qpTestLog_endShaderProgram(qpTestLog *log) in qpTestLog_endShaderProgram() argument
1068 DE_ASSERT(log); in qpTestLog_endShaderProgram()
1069 deMutex_lock(log->lock); in qpTestLog_endShaderProgram()
1072 if (!qpXmlWriter_endElement(log->writer, "ShaderProgram")) in qpTestLog_endShaderProgram()
1075 deMutex_unlock(log->lock); in qpTestLog_endShaderProgram()
1079 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SHADERPROGRAM); in qpTestLog_endShaderProgram()
1081 deMutex_unlock(log->lock); in qpTestLog_endShaderProgram()
1086 * \brief Write a OpenGL ES shader into the log.
1090 * \param infoLog Implementation provided shader compilation log
1092 bool qpTestLog_writeShader(qpTestLog *log, qpShaderType type, const char *source, bool compileOk, c… in qpTestLog_writeShader() argument
1095 …const char *sourceStr = ((log->flags & QP_TEST_LOG_EXCLUDE_SHADER_SOURCES) == 0 || !compileOk) ? s… in qpTestLog_writeShader()
1099 deMutex_lock(log->lock); in qpTestLog_writeShader()
1102 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SHADERPROGRAM); in qpTestLog_writeShader()
1106 if (!qpXmlWriter_startElement(log->writer, tagName, numShaderAttribs, shaderAttribs) || in qpTestLog_writeShader()
1107 !qpXmlWriter_writeStringElement(log->writer, "ShaderSource", sourceStr) || in qpTestLog_writeShader()
1108 !qpTestLog_writeInfoLog(log, infoLog) || !qpXmlWriter_endElement(log->writer, tagName)) in qpTestLog_writeShader()
1111 deMutex_unlock(log->lock); in qpTestLog_writeShader()
1115 deMutex_unlock(log->lock); in qpTestLog_writeShader()
1120 * \brief Start writing a set of EGL configurations into the log.
1122 bool qpTestLog_startEglConfigSet(qpTestLog *log, const char *name, const char *description) in qpTestLog_startEglConfigSet() argument
1127 DE_ASSERT(log && name); in qpTestLog_startEglConfigSet()
1128 deMutex_lock(log->lock); in qpTestLog_startEglConfigSet()
1135 if (!qpXmlWriter_startElement(log->writer, "EglConfigSet", numAttribs, attribs)) in qpTestLog_startEglConfigSet()
1138 deMutex_unlock(log->lock); in qpTestLog_startEglConfigSet()
1142 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_EGLCONFIGSET)); in qpTestLog_startEglConfigSet()
1144 deMutex_unlock(log->lock); in qpTestLog_startEglConfigSet()
1151 bool qpTestLog_endEglConfigSet(qpTestLog *log) in qpTestLog_endEglConfigSet() argument
1153 DE_ASSERT(log); in qpTestLog_endEglConfigSet()
1154 deMutex_lock(log->lock); in qpTestLog_endEglConfigSet()
1157 if (!qpXmlWriter_endElement(log->writer, "EglConfigSet")) in qpTestLog_endEglConfigSet()
1160 deMutex_unlock(log->lock); in qpTestLog_endEglConfigSet()
1164 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_EGLCONFIGSET); in qpTestLog_endEglConfigSet()
1166 deMutex_unlock(log->lock); in qpTestLog_endEglConfigSet()
1174 bool qpTestLog_writeEglConfig(qpTestLog *log, const qpEglConfigInfo *config) in qpTestLog_writeEglConfig() argument
1179 DE_ASSERT(log && config); in qpTestLog_writeEglConfig()
1180 deMutex_lock(log->lock); in qpTestLog_writeEglConfig()
1214 if (!qpXmlWriter_startElement(log->writer, "EglConfig", numAttribs, attribs) || in qpTestLog_writeEglConfig()
1215 !qpXmlWriter_endElement(log->writer, "EglConfig")) in qpTestLog_writeEglConfig()
1218 deMutex_unlock(log->lock); in qpTestLog_writeEglConfig()
1222 deMutex_unlock(log->lock); in qpTestLog_writeEglConfig()
1227 * \brief Start section in log.
1228 * \param log qpTestLog instance
1233 bool qpTestLog_startSection(qpTestLog *log, const char *name, const char *description) in qpTestLog_startSection() argument
1238 DE_ASSERT(log && name); in qpTestLog_startSection()
1239 deMutex_lock(log->lock); in qpTestLog_startSection()
1246 if (!qpXmlWriter_startElement(log->writer, "Section", numAttribs, attribs)) in qpTestLog_startSection()
1249 deMutex_unlock(log->lock); in qpTestLog_startSection()
1253 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SECTION)); in qpTestLog_startSection()
1255 deMutex_unlock(log->lock); in qpTestLog_startSection()
1260 * \brief End section in log.
1261 * \param log qpTestLog instance
1264 bool qpTestLog_endSection(qpTestLog *log) in qpTestLog_endSection() argument
1266 DE_ASSERT(log); in qpTestLog_endSection()
1267 deMutex_lock(log->lock); in qpTestLog_endSection()
1270 if (!qpXmlWriter_endElement(log->writer, "Section")) in qpTestLog_endSection()
1273 deMutex_unlock(log->lock); in qpTestLog_endSection()
1277 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SECTION); in qpTestLog_endSection()
1279 deMutex_unlock(log->lock); in qpTestLog_endSection()
1284 * \brief Write OpenCL compute kernel source into the log.
1286 bool qpTestLog_writeKernelSource(qpTestLog *log, const char *source) in qpTestLog_writeKernelSource() argument
1288 const char *sourceStr = (log->flags & QP_TEST_LOG_EXCLUDE_SHADER_SOURCES) != 0 ? "" : source; in qpTestLog_writeKernelSource()
1290 DE_ASSERT(log); in qpTestLog_writeKernelSource()
1291 deMutex_lock(log->lock); in qpTestLog_writeKernelSource()
1293 if (!qpXmlWriter_writeStringElement(log->writer, "KernelSource", sourceStr)) in qpTestLog_writeKernelSource()
1296 deMutex_unlock(log->lock); in qpTestLog_writeKernelSource()
1300 deMutex_unlock(log->lock); in qpTestLog_writeKernelSource()
1305 * \brief Write a SPIR-V module assembly source into the log.
1307 bool qpTestLog_writeSpirVAssemblySource(qpTestLog *log, const char *source) in qpTestLog_writeSpirVAssemblySource() argument
1309 …const char *const sourceStr = (log->flags & QP_TEST_LOG_EXCLUDE_SHADER_SOURCES) != 0 ? "" : source; in qpTestLog_writeSpirVAssemblySource()
1311 deMutex_lock(log->lock); in qpTestLog_writeSpirVAssemblySource()
1313 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SHADERPROGRAM); in qpTestLog_writeSpirVAssemblySource()
1315 if (!qpXmlWriter_writeStringElement(log->writer, "SpirVAssemblySource", sourceStr)) in qpTestLog_writeSpirVAssemblySource()
1318 deMutex_unlock(log->lock); in qpTestLog_writeSpirVAssemblySource()
1322 deMutex_unlock(log->lock); in qpTestLog_writeSpirVAssemblySource()
1327 * \brief Write OpenCL kernel compilation results into the log
1329 bool qpTestLog_writeCompileInfo(qpTestLog *log, const char *name, const char *description, bool com… in qpTestLog_writeCompileInfo() argument
1335 DE_ASSERT(log && name && description && infoLog); in qpTestLog_writeCompileInfo()
1336 deMutex_lock(log->lock); in qpTestLog_writeCompileInfo()
1342 if (!qpXmlWriter_startElement(log->writer, "CompileInfo", numAttribs, attribs) || in qpTestLog_writeCompileInfo()
1343 … !qpTestLog_writeInfoLog(log, infoLog) || !qpXmlWriter_endElement(log->writer, "CompileInfo")) in qpTestLog_writeCompileInfo()
1346 deMutex_unlock(log->lock); in qpTestLog_writeCompileInfo()
1350 deMutex_unlock(log->lock); in qpTestLog_writeCompileInfo()
1354 bool qpTestLog_startSampleList(qpTestLog *log, const char *name, const char *description) in qpTestLog_startSampleList() argument
1359 DE_ASSERT(log && name && description); in qpTestLog_startSampleList()
1360 deMutex_lock(log->lock); in qpTestLog_startSampleList()
1365 if (!qpXmlWriter_startElement(log->writer, "SampleList", numAttribs, attribs)) in qpTestLog_startSampleList()
1368 deMutex_unlock(log->lock); in qpTestLog_startSampleList()
1372 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SAMPLELIST)); in qpTestLog_startSampleList()
1374 deMutex_unlock(log->lock); in qpTestLog_startSampleList()
1378 bool qpTestLog_startSampleInfo(qpTestLog *log) in qpTestLog_startSampleInfo() argument
1380 DE_ASSERT(log); in qpTestLog_startSampleInfo()
1381 deMutex_lock(log->lock); in qpTestLog_startSampleInfo()
1383 if (!qpXmlWriter_startElement(log->writer, "SampleInfo", 0, DE_NULL)) in qpTestLog_startSampleInfo()
1386 deMutex_unlock(log->lock); in qpTestLog_startSampleInfo()
1390 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SAMPLEINFO)); in qpTestLog_startSampleInfo()
1392 deMutex_unlock(log->lock); in qpTestLog_startSampleInfo()
1396 bool qpTestLog_writeValueInfo(qpTestLog *log, const char *name, const char *description, const char… in qpTestLog_writeValueInfo() argument
1403 DE_ASSERT(log && name && description && tagName); in qpTestLog_writeValueInfo()
1404 deMutex_lock(log->lock); in qpTestLog_writeValueInfo()
1406 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SAMPLEINFO); in qpTestLog_writeValueInfo()
1415 if (!qpXmlWriter_startElement(log->writer, "ValueInfo", numAttribs, attribs) || in qpTestLog_writeValueInfo()
1416 !qpXmlWriter_endElement(log->writer, "ValueInfo")) in qpTestLog_writeValueInfo()
1419 deMutex_unlock(log->lock); in qpTestLog_writeValueInfo()
1423 deMutex_unlock(log->lock); in qpTestLog_writeValueInfo()
1427 bool qpTestLog_endSampleInfo(qpTestLog *log) in qpTestLog_endSampleInfo() argument
1429 DE_ASSERT(log); in qpTestLog_endSampleInfo()
1430 deMutex_lock(log->lock); in qpTestLog_endSampleInfo()
1432 if (!qpXmlWriter_endElement(log->writer, "SampleInfo")) in qpTestLog_endSampleInfo()
1435 deMutex_unlock(log->lock); in qpTestLog_endSampleInfo()
1439 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SAMPLEINFO); in qpTestLog_endSampleInfo()
1441 deMutex_unlock(log->lock); in qpTestLog_endSampleInfo()
1445 bool qpTestLog_startSample(qpTestLog *log) in qpTestLog_startSample() argument
1447 DE_ASSERT(log); in qpTestLog_startSample()
1448 deMutex_lock(log->lock); in qpTestLog_startSample()
1450 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SAMPLELIST); in qpTestLog_startSample()
1452 if (!qpXmlWriter_startElement(log->writer, "Sample", 0, DE_NULL)) in qpTestLog_startSample()
1455 deMutex_unlock(log->lock); in qpTestLog_startSample()
1459 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SAMPLE)); in qpTestLog_startSample()
1461 deMutex_unlock(log->lock); in qpTestLog_startSample()
1465 bool qpTestLog_writeValueFloat(qpTestLog *log, double value) in qpTestLog_writeValueFloat() argument
1470 deMutex_lock(log->lock); in qpTestLog_writeValueFloat()
1472 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SAMPLE); in qpTestLog_writeValueFloat()
1474 if (!qpXmlWriter_writeStringElement(log->writer, "Value", &tmpString[0])) in qpTestLog_writeValueFloat()
1477 deMutex_unlock(log->lock); in qpTestLog_writeValueFloat()
1481 deMutex_unlock(log->lock); in qpTestLog_writeValueFloat()
1485 bool qpTestLog_writeValueInteger(qpTestLog *log, int64_t value) in qpTestLog_writeValueInteger() argument
1490 deMutex_lock(log->lock); in qpTestLog_writeValueInteger()
1492 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SAMPLE); in qpTestLog_writeValueInteger()
1494 if (!qpXmlWriter_writeStringElement(log->writer, "Value", &tmpString[0])) in qpTestLog_writeValueInteger()
1497 deMutex_unlock(log->lock); in qpTestLog_writeValueInteger()
1501 deMutex_unlock(log->lock); in qpTestLog_writeValueInteger()
1505 bool qpTestLog_endSample(qpTestLog *log) in qpTestLog_endSample() argument
1507 DE_ASSERT(log); in qpTestLog_endSample()
1508 deMutex_lock(log->lock); in qpTestLog_endSample()
1510 if (!qpXmlWriter_endElement(log->writer, "Sample")) in qpTestLog_endSample()
1513 deMutex_unlock(log->lock); in qpTestLog_endSample()
1517 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SAMPLE); in qpTestLog_endSample()
1519 deMutex_unlock(log->lock); in qpTestLog_endSample()
1523 bool qpTestLog_endSampleList(qpTestLog *log) in qpTestLog_endSampleList() argument
1525 DE_ASSERT(log); in qpTestLog_endSampleList()
1526 deMutex_lock(log->lock); in qpTestLog_endSampleList()
1528 if (!qpXmlWriter_endElement(log->writer, "SampleList")) in qpTestLog_endSampleList()
1531 deMutex_unlock(log->lock); in qpTestLog_endSampleList()
1535 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SAMPLELIST); in qpTestLog_endSampleList()
1537 deMutex_unlock(log->lock); in qpTestLog_endSampleList()
1541 bool qpTestLog_writeRaw(qpTestLog *log, const char *rawContents) in qpTestLog_writeRaw() argument
1543 DE_ASSERT(log); in qpTestLog_writeRaw()
1545 fseek(log->outputFile, 0, SEEK_END); in qpTestLog_writeRaw()
1546 fprintf(log->outputFile, "%s", rawContents); in qpTestLog_writeRaw()
1547 if (!(log->flags & QP_TEST_LOG_NO_FLUSH)) in qpTestLog_writeRaw()
1548 qpTestLog_flushFile(log); in qpTestLog_writeRaw()
1553 uint32_t qpTestLog_getLogFlags(const qpTestLog *log) in qpTestLog_getLogFlags() argument
1555 DE_ASSERT(log); in qpTestLog_getLogFlags()
1556 return log->flags; in qpTestLog_getLogFlags()
1564 bool qpTestLog_isCompact(qpTestLog *log) in qpTestLog_isCompact() argument
1566 return (log->flags & QP_TEST_LOG_COMPACT) != 0; in qpTestLog_isCompact()