Lines Matching +full:log +full:-
1 /*-------------------------------------------------------------------------
3 * ----------------------------
11 * http://www.apache.org/licenses/LICENSE-2.0
22 *//*--------------------------------------------------------------------*/
94 return stack->numElements == 0; in ContainerStack_isEmpty()
99 if (stack->numElements == MAX_CONTAINER_STACK_DEPTH) in ContainerStack_push()
102 if (stack->numElements > 0 && !childContainersOk(stack->elements[stack->numElements-1])) in ContainerStack_push()
105 stack->elements[stack->numElements] = type; in ContainerStack_push()
106 stack->numElements += 1; in ContainerStack_push()
113 DE_ASSERT(stack->numElements > 0); in ContainerStack_pop()
114 stack->numElements -= 1; in ContainerStack_pop()
115 return stack->elements[stack->numElements]; in ContainerStack_pop()
120 if (stack->numElements > 0) in ContainerStack_getTop()
121 return stack->elements[stack->numElements-1]; in ContainerStack_getTop()
266 static void qpTestLog_flushFile (qpTestLog* log) in qpTestLog_flushFile() argument
268 DE_ASSERT(log && log->outputFile); in qpTestLog_flushFile()
269 fflush(log->outputFile); in qpTestLog_flushFile()
272 FlushFileBuffers((HANDLE)_get_osfhandle(_fileno(log->outputFile))); in qpTestLog_flushFile()
281 …DE_ASSERT(deInBounds32(key, 0, keyMapSize - 1)); /* Last element in map is assumed to be terminato… in qpLookupString()
282 …DE_ASSERT(keyMap[keyMapSize - 1].string == DE_NULL); /* Ensure map is properly completed, *_LAST e… in qpLookupString()
308 static deBool endSession (qpTestLog* log) in endSession() argument
310 DE_ASSERT(log && log->isSessionOpen); in endSession()
313 qpXmlWriter_flush(log->writer); in endSession()
315 deUint64 duration = deGetMicroseconds() - sessionStartTime; in endSession()
317 fprintf(log->outputFile, "\nRun took %.2f seconds\n", (float)duration / 1000000.0f); in endSession()
320 fprintf(log->outputFile, "\n#endSession\n"); in endSession()
321 qpTestLog_flushFile(log); in endSession()
323 log->isSessionOpen = DE_FALSE; in endSession()
328 /*--------------------------------------------------------------------*//*!
332 *//*--------------------------------------------------------------------*/
335 qpTestLog* log = (qpTestLog*)deCalloc(sizeof(qpTestLog)); in qpTestLog_createFileLog() local
336 if (!log) in qpTestLog_createFileLog()
342 ContainerStack_reset(&log->containerStack); in qpTestLog_createFileLog()
346 qpPrintf("Writing test log into %s\n", fileName); in qpTestLog_createFileLog()
349 log->outputFile = fopen(fileName, "wb"); in qpTestLog_createFileLog()
350 if (!log->outputFile) in qpTestLog_createFileLog()
352 qpPrintf("ERROR: Unable to open test log output file '%s'.\n", fileName); in qpTestLog_createFileLog()
353 qpTestLog_destroy(log); in qpTestLog_createFileLog()
357 log->flags = flags; in qpTestLog_createFileLog()
358 log->writer = qpXmlWriter_createFileWriter(log->outputFile, 0, !(flags & QP_TEST_LOG_NO_FLUSH)); in qpTestLog_createFileLog()
359 log->lock = deMutex_create(DE_NULL); in qpTestLog_createFileLog()
360 log->isSessionOpen = DE_FALSE; in qpTestLog_createFileLog()
361 log->isCaseOpen = DE_FALSE; in qpTestLog_createFileLog()
363 if (!log->writer) in qpTestLog_createFileLog()
366 qpTestLog_destroy(log); in qpTestLog_createFileLog()
370 if (!log->lock) in qpTestLog_createFileLog()
373 qpTestLog_destroy(log); in qpTestLog_createFileLog()
377 return log; in qpTestLog_createFileLog()
380 /*--------------------------------------------------------------------*//*!
381 * \brief Log information about test session
382 * \param log qpTestLog instance
384 *//*--------------------------------------------------------------------*/
385 deBool qpTestLog_beginSession(qpTestLog* log, const char* additionalSessionInfo) in qpTestLog_beginSession() argument
387 DE_ASSERT(log); in qpTestLog_beginSession()
390 if (log->isSessionOpen) in qpTestLog_beginSession()
394 fprintf(log->outputFile, "#sessionInfo releaseName %s\n", qpGetReleaseName()); in qpTestLog_beginSession()
395 fprintf(log->outputFile, "#sessionInfo releaseId 0x%08x\n", qpGetReleaseId()); in qpTestLog_beginSession()
396 fprintf(log->outputFile, "#sessionInfo targetName \"%s\"\n", qpGetTargetName()); in qpTestLog_beginSession()
398 if(qpTestLog_isCompact(log)) in qpTestLog_beginSession()
400 compactStr = "-compact"; in qpTestLog_beginSession()
402 …fprintf(log->outputFile, "#sessionInfo logFormatVersion \"%s%s\"\n", LOG_FORMAT_VERSION, compactSt… in qpTestLog_beginSession()
405 fprintf(log->outputFile, "%s\n", additionalSessionInfo); in qpTestLog_beginSession()
408 fprintf(log->outputFile, "#beginSession\n"); in qpTestLog_beginSession()
409 qpTestLog_flushFile(log); in qpTestLog_beginSession()
412 log->isSessionOpen = DE_TRUE; in qpTestLog_beginSession()
417 /*--------------------------------------------------------------------*//*!
419 * \param log qpTestLog instance
420 *//*--------------------------------------------------------------------*/
421 void qpTestLog_destroy (qpTestLog* log) in qpTestLog_destroy() argument
423 DE_ASSERT(log); in qpTestLog_destroy()
425 if (log->isSessionOpen) in qpTestLog_destroy()
426 endSession(log); in qpTestLog_destroy()
428 if (log->writer) in qpTestLog_destroy()
429 qpXmlWriter_destroy(log->writer); in qpTestLog_destroy()
431 if (log->outputFile) in qpTestLog_destroy()
432 fclose(log->outputFile); in qpTestLog_destroy()
434 if (log->lock) in qpTestLog_destroy()
435 deMutex_destroy(log->lock); in qpTestLog_destroy()
437 deFree(log); in qpTestLog_destroy()
440 /*--------------------------------------------------------------------*//*!
441 * \brief Log start of test case
442 * \param log qpTestLog instance
446 *//*--------------------------------------------------------------------*/
447 deBool qpTestLog_startCase (qpTestLog* log, const char* testCasePath, qpTestCaseType testCaseType) in qpTestLog_startCase() argument
453 DE_ASSERT(log && testCasePath && (testCasePath[0] != 0)); in qpTestLog_startCase()
454 deMutex_lock(log->lock); in qpTestLog_startCase()
456 DE_ASSERT(!log->isCaseOpen); in qpTestLog_startCase()
457 DE_ASSERT(ContainerStack_isEmpty(&log->containerStack)); in qpTestLog_startCase()
460 qpXmlWriter_flush(log->writer); in qpTestLog_startCase()
461 if (!qpTestLog_isCompact(log)) in qpTestLog_startCase()
463 fprintf(log->outputFile, "\n#beginTestCaseResult %s\n", testCasePath); in qpTestLog_startCase()
465 if (!(log->flags & QP_TEST_LOG_NO_FLUSH)) in qpTestLog_startCase()
466 qpTestLog_flushFile(log); in qpTestLog_startCase()
468 log->isCaseOpen = DE_TRUE; in qpTestLog_startCase()
472 if (!qpTestLog_isCompact(log)) in qpTestLog_startCase()
478 if (!qpXmlWriter_startDocument(log->writer, !qpTestLog_isCompact(log)) || in qpTestLog_startCase()
479 !qpXmlWriter_startElement(log->writer, "TestCaseResult", numResultAttribs, resultAttribs)) in qpTestLog_startCase()
482 deMutex_unlock(log->lock); in qpTestLog_startCase()
486 deMutex_unlock(log->lock); in qpTestLog_startCase()
490 /*--------------------------------------------------------------------*//*!
491 * \brief Log end of test case
492 * \param log qpTestLog instance
496 *//*--------------------------------------------------------------------*/
497 deBool qpTestLog_endCase (qpTestLog* log, qpTestResult result, const char* resultDetails) in qpTestLog_endCase() argument
502 deMutex_lock(log->lock); in qpTestLog_endCase()
504 DE_ASSERT(log->isCaseOpen); in qpTestLog_endCase()
505 DE_ASSERT(ContainerStack_isEmpty(&log->containerStack)); in qpTestLog_endCase()
510 if (!qpXmlWriter_startElement(log->writer, "Result", 1, &statusAttrib) || in qpTestLog_endCase()
511 (resultDetails && !qpXmlWriter_writeString(log->writer, resultDetails)) || in qpTestLog_endCase()
512 !qpXmlWriter_endElement(log->writer, "Result") || in qpTestLog_endCase()
513 !qpXmlWriter_endElement(log->writer, "TestCaseResult") || in qpTestLog_endCase()
514 !qpXmlWriter_endDocument(log->writer)) /* Close any XML elements still open */ in qpTestLog_endCase()
517 deMutex_unlock(log->lock); in qpTestLog_endCase()
522 qpXmlWriter_flush(log->writer); in qpTestLog_endCase()
523 if(!qpTestLog_isCompact(log)) in qpTestLog_endCase()
525 fprintf(log->outputFile, "\n#endTestCaseResult\n"); in qpTestLog_endCase()
527 if (!(log->flags & QP_TEST_LOG_NO_FLUSH)) in qpTestLog_endCase()
528 qpTestLog_flushFile(log); in qpTestLog_endCase()
530 log->isCaseOpen = DE_FALSE; in qpTestLog_endCase()
532 deMutex_unlock(log->lock); in qpTestLog_endCase()
536 deBool qpTestLog_startTestsCasesTime (qpTestLog* log) in qpTestLog_startTestsCasesTime() argument
538 DE_ASSERT(log); in qpTestLog_startTestsCasesTime()
539 deMutex_lock(log->lock); in qpTestLog_startTestsCasesTime()
542 qpXmlWriter_flush(log->writer); in qpTestLog_startTestsCasesTime()
543 fprintf(log->outputFile, "\n#beginTestsCasesTime\n"); in qpTestLog_startTestsCasesTime()
545 log->isCaseOpen = DE_TRUE; in qpTestLog_startTestsCasesTime()
547 if (!qpXmlWriter_startDocument(log->writer, !qpTestLog_isCompact(log)) || in qpTestLog_startTestsCasesTime()
548 !qpXmlWriter_startElement(log->writer, "TestsCasesTime", 0, (const qpXmlAttribute*)DE_NULL)) in qpTestLog_startTestsCasesTime()
551 deMutex_unlock(log->lock); in qpTestLog_startTestsCasesTime()
555 deMutex_unlock(log->lock); in qpTestLog_startTestsCasesTime()
559 deBool qpTestLog_endTestsCasesTime (qpTestLog* log) in qpTestLog_endTestsCasesTime() argument
561 DE_ASSERT(log); in qpTestLog_endTestsCasesTime()
562 deMutex_lock(log->lock); in qpTestLog_endTestsCasesTime()
564 DE_ASSERT(log->isCaseOpen); in qpTestLog_endTestsCasesTime()
566 if (!qpXmlWriter_endElement(log->writer, "TestsCasesTime") || in qpTestLog_endTestsCasesTime()
567 !qpXmlWriter_endDocument(log->writer)) in qpTestLog_endTestsCasesTime()
570 deMutex_unlock(log->lock); in qpTestLog_endTestsCasesTime()
574 qpXmlWriter_flush(log->writer); in qpTestLog_endTestsCasesTime()
576 fprintf(log->outputFile, "\n#endTestsCasesTime\n"); in qpTestLog_endTestsCasesTime()
578 log->isCaseOpen = DE_FALSE; in qpTestLog_endTestsCasesTime()
580 deMutex_unlock(log->lock); in qpTestLog_endTestsCasesTime()
585 /*--------------------------------------------------------------------*//*!
587 * \param log qpTestLog instance
590 *//*--------------------------------------------------------------------*/
591 deBool qpTestLog_terminateCase (qpTestLog* log, qpTestResult result) in qpTestLog_terminateCase() argument
595 DE_ASSERT(log); in qpTestLog_terminateCase()
598 deMutex_lock(log->lock); in qpTestLog_terminateCase()
600 if (!log->isCaseOpen) in qpTestLog_terminateCase()
602 deMutex_unlock(log->lock); in qpTestLog_terminateCase()
607 qpXmlWriter_flush(log->writer); in qpTestLog_terminateCase()
608 fprintf(log->outputFile, "\n#terminateTestCaseResult %s\n", resultStr); in qpTestLog_terminateCase()
609 qpTestLog_flushFile(log); in qpTestLog_terminateCase()
611 log->isCaseOpen = DE_FALSE; in qpTestLog_terminateCase()
614 ContainerStack_reset(&log->containerStack); in qpTestLog_terminateCase()
617 deMutex_unlock(log->lock); in qpTestLog_terminateCase()
621 static deBool qpTestLog_writeKeyValuePair (qpTestLog* log, const char* elementName, const char* nam… in qpTestLog_writeKeyValuePair() argument
627 DE_ASSERT(log && elementName && text); in qpTestLog_writeKeyValuePair()
628 deMutex_lock(log->lock); in qpTestLog_writeKeyValuePair()
636 if (!qpXmlWriter_startElement(log->writer, elementName, numAttribs, attribs) || in qpTestLog_writeKeyValuePair()
637 !qpXmlWriter_writeString(log->writer, text) || in qpTestLog_writeKeyValuePair()
638 !qpXmlWriter_endElement(log->writer, elementName)) in qpTestLog_writeKeyValuePair()
641 deMutex_unlock(log->lock); in qpTestLog_writeKeyValuePair()
645 deMutex_unlock(log->lock); in qpTestLog_writeKeyValuePair()
649 /*--------------------------------------------------------------------*//*!
650 * \brief Write key-value-pair into log
651 * \param log qpTestLog instance
655 * \param value Value of the key-value-pair
657 *//*--------------------------------------------------------------------*/
658 deBool qpTestLog_writeText (qpTestLog* log, const char* name, const char* description, qpKeyValueTa… in qpTestLog_writeText() argument
661 return qpTestLog_writeKeyValuePair(log, "Text", name, description, DE_NULL, tag, text); in qpTestLog_writeText()
664 /*--------------------------------------------------------------------*//*!
665 * \brief Write key-value-pair into log
666 * \param log qpTestLog instance
670 * \param value Value of the key-value-pair
672 *//*--------------------------------------------------------------------*/
673 deBool qpTestLog_writeInteger (qpTestLog* log, const char* name, const char* description, const cha… in qpTestLog_writeInteger() argument
679 return qpTestLog_writeKeyValuePair(log, "Number", name, description, unit, tag, tmpString); in qpTestLog_writeInteger()
682 /*--------------------------------------------------------------------*//*!
683 * \brief Write key-value-pair into log
684 * \param log qpTestLog instance
688 * \param value Value of the key-value-pair
690 *//*--------------------------------------------------------------------*/
691 deBool qpTestLog_writeFloat (qpTestLog* log, const char* name, const char* description, const char*… in qpTestLog_writeFloat() argument
697 return qpTestLog_writeKeyValuePair(log, "Number", name, description, unit, tag, tmpString); in qpTestLog_writeFloat()
709 buffer->capacity = 0; in Buffer_init()
710 buffer->size = 0; in Buffer_init()
711 buffer->data = DE_NULL; in Buffer_init()
716 deFree(buffer->data); in Buffer_deinit()
723 if (newSize > buffer->capacity) in Buffer_resize()
725 size_t newCapacity = (size_t)deAlign32(deMax32(2*(int)buffer->capacity, (int)newSize), 512); in Buffer_resize()
730 if (buffer->data) in Buffer_resize()
731 memcpy(newData, buffer->data, buffer->size); in Buffer_resize()
733 deFree(buffer->data); in Buffer_resize()
734 buffer->data = newData; in Buffer_resize()
735 buffer->capacity = newCapacity; in Buffer_resize()
738 buffer->size = newSize; in Buffer_resize()
744 size_t offset = buffer->size; in Buffer_append()
746 if (!Buffer_resize(buffer, buffer->size + numBytes)) in Buffer_append()
750 memcpy(&buffer->data[offset], data, numBytes); in Buffer_append()
835 /*--------------------------------------------------------------------*//*!
837 * \param log qpTestLog instance
841 *//*--------------------------------------------------------------------*/
842 deBool qpTestLog_startImageSet (qpTestLog* log, const char* name, const char* description) in qpTestLog_startImageSet() argument
847 DE_ASSERT(log && name); in qpTestLog_startImageSet()
848 deMutex_lock(log->lock); in qpTestLog_startImageSet()
855 if (!qpXmlWriter_startElement(log->writer, "ImageSet", numAttribs, attribs)) in qpTestLog_startImageSet()
858 deMutex_unlock(log->lock); in qpTestLog_startImageSet()
862 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_IMAGESET)); in qpTestLog_startImageSet()
864 deMutex_unlock(log->lock); in qpTestLog_startImageSet()
868 /*--------------------------------------------------------------------*//*!
870 * \param log qpTestLog instance
872 *//*--------------------------------------------------------------------*/
873 deBool qpTestLog_endImageSet (qpTestLog* log) in qpTestLog_endImageSet() argument
875 DE_ASSERT(log); in qpTestLog_endImageSet()
876 deMutex_lock(log->lock); in qpTestLog_endImageSet()
879 if (!qpXmlWriter_endElement(log->writer, "ImageSet")) in qpTestLog_endImageSet()
882 deMutex_unlock(log->lock); in qpTestLog_endImageSet()
886 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_IMAGESET); in qpTestLog_endImageSet()
888 deMutex_unlock(log->lock); in qpTestLog_endImageSet()
892 /*--------------------------------------------------------------------*//*!
893 * \brief Write base64 encoded raw image data into log
894 * \param log qpTestLog instance
904 *//*--------------------------------------------------------------------*/
906 qpTestLog* log, in qpTestLog_writeImage() argument
924 DE_ASSERT(log && name); in qpTestLog_writeImage()
929 if (log->flags & QP_TEST_LOG_EXCLUDE_IMAGES) in qpTestLog_writeImage()
956 /* Fall-back to default compression. */ in qpTestLog_writeImage()
957 qpPrintf("WARNING: PNG compression failed -- storing image uncompressed.\n"); in qpTestLog_writeImage()
975 /* Need to re-pack pixels. */ in qpTestLog_writeImage()
1016 /* \note Log lock is acquired after compression! */ in qpTestLog_writeImage()
1017 deMutex_lock(log->lock); in qpTestLog_writeImage()
1020 if (!qpXmlWriter_startElement(log->writer, "Image", numAttribs, attribs) || in qpTestLog_writeImage()
1021 !qpXmlWriter_writeBase64(log->writer, (const deUint8*)writeDataPtr, writeDataBytes) || in qpTestLog_writeImage()
1022 !qpXmlWriter_endElement(log->writer, "Image")) in qpTestLog_writeImage()
1025 deMutex_unlock(log->lock); in qpTestLog_writeImage()
1030 deMutex_unlock(log->lock); in qpTestLog_writeImage()
1038 /*--------------------------------------------------------------------*//*!
1039 * \brief Writes infoLog into log. Might filter out empty infoLog.
1040 * \param log qpTestLog instance
1041 * \param infoLog Implementation provided shader compilation or linkage log
1043 *//*--------------------------------------------------------------------*/
1044 deBool qpTestLog_writeInfoLog (qpTestLog* log, const char* infoLog) in qpTestLog_writeInfoLog() argument
1049 if (infoLog[0] == '\0' && (log->flags & QP_TEST_LOG_EXCLUDE_EMPTY_LOGINFO) != 0) in qpTestLog_writeInfoLog()
1052 return qpXmlWriter_writeStringElement(log->writer, "InfoLog", infoLog); in qpTestLog_writeInfoLog()
1055 /*--------------------------------------------------------------------*//*!
1056 * \brief Write a OpenGL ES shader program into the log.
1058 * \param linkInfoLog Implementation provided linkage log
1059 *//*--------------------------------------------------------------------*/
1060 deBool qpTestLog_startShaderProgram (qpTestLog* log, deBool linkOk, const char* linkInfoLog) in qpTestLog_startShaderProgram() argument
1065 DE_ASSERT(log); in qpTestLog_startShaderProgram()
1066 deMutex_lock(log->lock); in qpTestLog_startShaderProgram()
1070 if (!qpXmlWriter_startElement(log->writer, "ShaderProgram", numProgramAttribs, programAttribs) || in qpTestLog_startShaderProgram()
1071 !qpTestLog_writeInfoLog(log, linkInfoLog)) in qpTestLog_startShaderProgram()
1074 deMutex_unlock(log->lock); in qpTestLog_startShaderProgram()
1078 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SHADERPROGRAM)); in qpTestLog_startShaderProgram()
1080 deMutex_unlock(log->lock); in qpTestLog_startShaderProgram()
1084 /*--------------------------------------------------------------------*//*!
1086 * \param log qpTestLog instance
1088 *//*--------------------------------------------------------------------*/
1089 deBool qpTestLog_endShaderProgram (qpTestLog* log) in qpTestLog_endShaderProgram() argument
1091 DE_ASSERT(log); in qpTestLog_endShaderProgram()
1092 deMutex_lock(log->lock); in qpTestLog_endShaderProgram()
1095 if (!qpXmlWriter_endElement(log->writer, "ShaderProgram")) in qpTestLog_endShaderProgram()
1098 deMutex_unlock(log->lock); in qpTestLog_endShaderProgram()
1102 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SHADERPROGRAM); in qpTestLog_endShaderProgram()
1104 deMutex_unlock(log->lock); in qpTestLog_endShaderProgram()
1108 /*--------------------------------------------------------------------*//*!
1109 * \brief Write a OpenGL ES shader into the log.
1113 * \param infoLog Implementation provided shader compilation log
1114 *//*--------------------------------------------------------------------*/
1115 deBool qpTestLog_writeShader (qpTestLog* log, qpShaderType type, const char* source, deBool compile… in qpTestLog_writeShader() argument
1118 …const char* sourceStr = ((log->flags & QP_TEST_LOG_EXCLUDE_SHADER_SOURCES) == 0 || !compileOk) … in qpTestLog_writeShader()
1122 deMutex_lock(log->lock); in qpTestLog_writeShader()
1125 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SHADERPROGRAM); in qpTestLog_writeShader()
1129 if (!qpXmlWriter_startElement(log->writer, tagName, numShaderAttribs, shaderAttribs) || in qpTestLog_writeShader()
1130 !qpXmlWriter_writeStringElement(log->writer, "ShaderSource", sourceStr) || in qpTestLog_writeShader()
1131 !qpTestLog_writeInfoLog(log, infoLog) || in qpTestLog_writeShader()
1132 !qpXmlWriter_endElement(log->writer, tagName)) in qpTestLog_writeShader()
1135 deMutex_unlock(log->lock); in qpTestLog_writeShader()
1139 deMutex_unlock(log->lock); in qpTestLog_writeShader()
1143 /*--------------------------------------------------------------------*//*!
1144 * \brief Start writing a set of EGL configurations into the log.
1145 *//*--------------------------------------------------------------------*/
1146 deBool qpTestLog_startEglConfigSet (qpTestLog* log, const char* name, const char* description) in qpTestLog_startEglConfigSet() argument
1151 DE_ASSERT(log && name); in qpTestLog_startEglConfigSet()
1152 deMutex_lock(log->lock); in qpTestLog_startEglConfigSet()
1159 if (!qpXmlWriter_startElement(log->writer, "EglConfigSet", numAttribs, attribs)) in qpTestLog_startEglConfigSet()
1162 deMutex_unlock(log->lock); in qpTestLog_startEglConfigSet()
1166 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_EGLCONFIGSET)); in qpTestLog_startEglConfigSet()
1168 deMutex_unlock(log->lock); in qpTestLog_startEglConfigSet()
1172 /*--------------------------------------------------------------------*//*!
1174 *//*--------------------------------------------------------------------*/
1175 deBool qpTestLog_endEglConfigSet (qpTestLog* log) in qpTestLog_endEglConfigSet() argument
1177 DE_ASSERT(log); in qpTestLog_endEglConfigSet()
1178 deMutex_lock(log->lock); in qpTestLog_endEglConfigSet()
1181 if (!qpXmlWriter_endElement(log->writer, "EglConfigSet")) in qpTestLog_endEglConfigSet()
1184 deMutex_unlock(log->lock); in qpTestLog_endEglConfigSet()
1188 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_EGLCONFIGSET); in qpTestLog_endEglConfigSet()
1190 deMutex_unlock(log->lock); in qpTestLog_endEglConfigSet()
1194 /*--------------------------------------------------------------------*//*!
1197 *//*--------------------------------------------------------------------*/
1198 deBool qpTestLog_writeEglConfig (qpTestLog* log, const qpEglConfigInfo* config) in qpTestLog_writeEglConfig() argument
1203 DE_ASSERT(log && config); in qpTestLog_writeEglConfig()
1204 deMutex_lock(log->lock); in qpTestLog_writeEglConfig()
1206 attribs[numAttribs++] = qpSetIntAttrib ("BufferSize", config->bufferSize); in qpTestLog_writeEglConfig()
1207 attribs[numAttribs++] = qpSetIntAttrib ("RedSize", config->redSize); in qpTestLog_writeEglConfig()
1208 attribs[numAttribs++] = qpSetIntAttrib ("GreenSize", config->greenSize); in qpTestLog_writeEglConfig()
1209 attribs[numAttribs++] = qpSetIntAttrib ("BlueSize", config->blueSize); in qpTestLog_writeEglConfig()
1210 attribs[numAttribs++] = qpSetIntAttrib ("LuminanceSize", config->luminanceSize); in qpTestLog_writeEglConfig()
1211 attribs[numAttribs++] = qpSetIntAttrib ("AlphaSize", config->alphaSize); in qpTestLog_writeEglConfig()
1212 attribs[numAttribs++] = qpSetIntAttrib ("AlphaMaskSize", config->alphaMaskSize); in qpTestLog_writeEglConfig()
1213 attribs[numAttribs++] = qpSetBoolAttrib ("BindToTextureRGB", config->bindToTextureRGB); in qpTestLog_writeEglConfig()
1214 attribs[numAttribs++] = qpSetBoolAttrib ("BindToTextureRGBA", config->bindToTextureRGBA); in qpTestLog_writeEglConfig()
1215 attribs[numAttribs++] = qpSetStringAttrib ("ColorBufferType", config->colorBufferType); in qpTestLog_writeEglConfig()
1216 attribs[numAttribs++] = qpSetStringAttrib ("ConfigCaveat", config->configCaveat); in qpTestLog_writeEglConfig()
1217 attribs[numAttribs++] = qpSetIntAttrib ("ConfigID", config->configID); in qpTestLog_writeEglConfig()
1218 attribs[numAttribs++] = qpSetStringAttrib ("Conformant", config->conformant); in qpTestLog_writeEglConfig()
1219 attribs[numAttribs++] = qpSetIntAttrib ("DepthSize", config->depthSize); in qpTestLog_writeEglConfig()
1220 attribs[numAttribs++] = qpSetIntAttrib ("Level", config->level); in qpTestLog_writeEglConfig()
1221 attribs[numAttribs++] = qpSetIntAttrib ("MaxPBufferWidth", config->maxPBufferWidth); in qpTestLog_writeEglConfig()
1222 attribs[numAttribs++] = qpSetIntAttrib ("MaxPBufferHeight", config->maxPBufferHeight); in qpTestLog_writeEglConfig()
1223 attribs[numAttribs++] = qpSetIntAttrib ("MaxPBufferPixels", config->maxPBufferPixels); in qpTestLog_writeEglConfig()
1224 attribs[numAttribs++] = qpSetIntAttrib ("MaxSwapInterval", config->maxSwapInterval); in qpTestLog_writeEglConfig()
1225 attribs[numAttribs++] = qpSetIntAttrib ("MinSwapInterval", config->minSwapInterval); in qpTestLog_writeEglConfig()
1226 attribs[numAttribs++] = qpSetBoolAttrib ("NativeRenderable", config->nativeRenderable); in qpTestLog_writeEglConfig()
1227 attribs[numAttribs++] = qpSetStringAttrib ("RenderableType", config->renderableType); in qpTestLog_writeEglConfig()
1228 attribs[numAttribs++] = qpSetIntAttrib ("SampleBuffers", config->sampleBuffers); in qpTestLog_writeEglConfig()
1229 attribs[numAttribs++] = qpSetIntAttrib ("Samples", config->samples); in qpTestLog_writeEglConfig()
1230 attribs[numAttribs++] = qpSetIntAttrib ("StencilSize", config->stencilSize); in qpTestLog_writeEglConfig()
1231 attribs[numAttribs++] = qpSetStringAttrib ("SurfaceTypes", config->surfaceTypes); in qpTestLog_writeEglConfig()
1232 attribs[numAttribs++] = qpSetStringAttrib ("TransparentType", config->transparentType); in qpTestLog_writeEglConfig()
1233 attribs[numAttribs++] = qpSetIntAttrib ("TransparentRedValue", config->transparentRedValue); in qpTestLog_writeEglConfig()
1234 attribs[numAttribs++] = qpSetIntAttrib ("TransparentGreenValue", config->transparentGreenValue); in qpTestLog_writeEglConfig()
1235 attribs[numAttribs++] = qpSetIntAttrib ("TransparentBlueValue", config->transparentBlueValue); in qpTestLog_writeEglConfig()
1238 if (!qpXmlWriter_startElement(log->writer, "EglConfig", numAttribs, attribs) || in qpTestLog_writeEglConfig()
1239 !qpXmlWriter_endElement(log->writer, "EglConfig")) in qpTestLog_writeEglConfig()
1242 deMutex_unlock(log->lock); in qpTestLog_writeEglConfig()
1246 deMutex_unlock(log->lock); in qpTestLog_writeEglConfig()
1250 /*--------------------------------------------------------------------*//*!
1251 * \brief Start section in log.
1252 * \param log qpTestLog instance
1256 *//*--------------------------------------------------------------------*/
1257 deBool qpTestLog_startSection (qpTestLog* log, const char* name, const char* description) in qpTestLog_startSection() argument
1262 DE_ASSERT(log && name); in qpTestLog_startSection()
1263 deMutex_lock(log->lock); in qpTestLog_startSection()
1270 if (!qpXmlWriter_startElement(log->writer, "Section", numAttribs, attribs)) in qpTestLog_startSection()
1273 deMutex_unlock(log->lock); in qpTestLog_startSection()
1277 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SECTION)); in qpTestLog_startSection()
1279 deMutex_unlock(log->lock); in qpTestLog_startSection()
1283 /*--------------------------------------------------------------------*//*!
1284 * \brief End section in log.
1285 * \param log qpTestLog instance
1287 *//*--------------------------------------------------------------------*/
1288 deBool qpTestLog_endSection (qpTestLog* log) in qpTestLog_endSection() argument
1290 DE_ASSERT(log); in qpTestLog_endSection()
1291 deMutex_lock(log->lock); in qpTestLog_endSection()
1294 if (!qpXmlWriter_endElement(log->writer, "Section")) in qpTestLog_endSection()
1297 deMutex_unlock(log->lock); in qpTestLog_endSection()
1301 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SECTION); in qpTestLog_endSection()
1303 deMutex_unlock(log->lock); in qpTestLog_endSection()
1307 /*--------------------------------------------------------------------*//*!
1308 * \brief Write OpenCL compute kernel source into the log.
1309 *//*--------------------------------------------------------------------*/
1310 deBool qpTestLog_writeKernelSource (qpTestLog* log, const char* source) in qpTestLog_writeKernelSource() argument
1312 const char* sourceStr = (log->flags & QP_TEST_LOG_EXCLUDE_SHADER_SOURCES) != 0 ? "" : source; in qpTestLog_writeKernelSource()
1314 DE_ASSERT(log); in qpTestLog_writeKernelSource()
1315 deMutex_lock(log->lock); in qpTestLog_writeKernelSource()
1317 if (!qpXmlWriter_writeStringElement(log->writer, "KernelSource", sourceStr)) in qpTestLog_writeKernelSource()
1320 deMutex_unlock(log->lock); in qpTestLog_writeKernelSource()
1324 deMutex_unlock(log->lock); in qpTestLog_writeKernelSource()
1328 /*--------------------------------------------------------------------*//*!
1329 * \brief Write a SPIR-V module assembly source into the log.
1330 *//*--------------------------------------------------------------------*/
1331 deBool qpTestLog_writeSpirVAssemblySource (qpTestLog* log, const char* source) in qpTestLog_writeSpirVAssemblySource() argument
1333 const char* const sourceStr = (log->flags & QP_TEST_LOG_EXCLUDE_SHADER_SOURCES) != 0 ? "" : source; in qpTestLog_writeSpirVAssemblySource()
1335 deMutex_lock(log->lock); in qpTestLog_writeSpirVAssemblySource()
1337 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SHADERPROGRAM); in qpTestLog_writeSpirVAssemblySource()
1339 if (!qpXmlWriter_writeStringElement(log->writer, "SpirVAssemblySource", sourceStr)) in qpTestLog_writeSpirVAssemblySource()
1342 deMutex_unlock(log->lock); in qpTestLog_writeSpirVAssemblySource()
1346 deMutex_unlock(log->lock); in qpTestLog_writeSpirVAssemblySource()
1350 /*--------------------------------------------------------------------*//*!
1351 * \brief Write OpenCL kernel compilation results into the log
1352 *//*--------------------------------------------------------------------*/
1353 deBool qpTestLog_writeCompileInfo (qpTestLog* log, const char* name, const char* description, deBoo… in qpTestLog_writeCompileInfo() argument
1358 DE_ASSERT(log && name && description && infoLog); in qpTestLog_writeCompileInfo()
1359 deMutex_lock(log->lock); in qpTestLog_writeCompileInfo()
1365 if (!qpXmlWriter_startElement(log->writer, "CompileInfo", numAttribs, attribs) || in qpTestLog_writeCompileInfo()
1366 !qpTestLog_writeInfoLog(log, infoLog) || in qpTestLog_writeCompileInfo()
1367 !qpXmlWriter_endElement(log->writer, "CompileInfo")) in qpTestLog_writeCompileInfo()
1370 deMutex_unlock(log->lock); in qpTestLog_writeCompileInfo()
1374 deMutex_unlock(log->lock); in qpTestLog_writeCompileInfo()
1378 deBool qpTestLog_startSampleList (qpTestLog* log, const char* name, const char* description) in qpTestLog_startSampleList() argument
1383 DE_ASSERT(log && name && description); in qpTestLog_startSampleList()
1384 deMutex_lock(log->lock); in qpTestLog_startSampleList()
1389 if (!qpXmlWriter_startElement(log->writer, "SampleList", numAttribs, attribs)) in qpTestLog_startSampleList()
1392 deMutex_unlock(log->lock); in qpTestLog_startSampleList()
1396 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SAMPLELIST)); in qpTestLog_startSampleList()
1398 deMutex_unlock(log->lock); in qpTestLog_startSampleList()
1402 deBool qpTestLog_startSampleInfo (qpTestLog* log) in qpTestLog_startSampleInfo() argument
1404 DE_ASSERT(log); in qpTestLog_startSampleInfo()
1405 deMutex_lock(log->lock); in qpTestLog_startSampleInfo()
1407 if (!qpXmlWriter_startElement(log->writer, "SampleInfo", 0, DE_NULL)) in qpTestLog_startSampleInfo()
1410 deMutex_unlock(log->lock); in qpTestLog_startSampleInfo()
1414 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SAMPLEINFO)); in qpTestLog_startSampleInfo()
1416 deMutex_unlock(log->lock); in qpTestLog_startSampleInfo()
1420 deBool qpTestLog_writeValueInfo (qpTestLog* log, const char* name, const char* description, const c… in qpTestLog_writeValueInfo() argument
1426 DE_ASSERT(log && name && description && tagName); in qpTestLog_writeValueInfo()
1427 deMutex_lock(log->lock); in qpTestLog_writeValueInfo()
1429 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SAMPLEINFO); in qpTestLog_writeValueInfo()
1438 if (!qpXmlWriter_startElement(log->writer, "ValueInfo", numAttribs, attribs) || in qpTestLog_writeValueInfo()
1439 !qpXmlWriter_endElement(log->writer, "ValueInfo")) in qpTestLog_writeValueInfo()
1442 deMutex_unlock(log->lock); in qpTestLog_writeValueInfo()
1446 deMutex_unlock(log->lock); in qpTestLog_writeValueInfo()
1450 deBool qpTestLog_endSampleInfo (qpTestLog* log) in qpTestLog_endSampleInfo() argument
1452 DE_ASSERT(log); in qpTestLog_endSampleInfo()
1453 deMutex_lock(log->lock); in qpTestLog_endSampleInfo()
1455 if (!qpXmlWriter_endElement(log->writer, "SampleInfo")) in qpTestLog_endSampleInfo()
1458 deMutex_unlock(log->lock); in qpTestLog_endSampleInfo()
1462 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SAMPLEINFO); in qpTestLog_endSampleInfo()
1464 deMutex_unlock(log->lock); in qpTestLog_endSampleInfo()
1468 deBool qpTestLog_startSample (qpTestLog* log) in qpTestLog_startSample() argument
1470 DE_ASSERT(log); in qpTestLog_startSample()
1471 deMutex_lock(log->lock); in qpTestLog_startSample()
1473 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SAMPLELIST); in qpTestLog_startSample()
1475 if (!qpXmlWriter_startElement(log->writer, "Sample", 0, DE_NULL)) in qpTestLog_startSample()
1478 deMutex_unlock(log->lock); in qpTestLog_startSample()
1482 DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SAMPLE)); in qpTestLog_startSample()
1484 deMutex_unlock(log->lock); in qpTestLog_startSample()
1488 deBool qpTestLog_writeValueFloat (qpTestLog* log, double value) in qpTestLog_writeValueFloat() argument
1493 deMutex_lock(log->lock); in qpTestLog_writeValueFloat()
1495 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SAMPLE); in qpTestLog_writeValueFloat()
1497 if (!qpXmlWriter_writeStringElement(log->writer, "Value", &tmpString[0])) in qpTestLog_writeValueFloat()
1500 deMutex_unlock(log->lock); in qpTestLog_writeValueFloat()
1504 deMutex_unlock(log->lock); in qpTestLog_writeValueFloat()
1508 deBool qpTestLog_writeValueInteger (qpTestLog* log, deInt64 value) in qpTestLog_writeValueInteger() argument
1513 deMutex_lock(log->lock); in qpTestLog_writeValueInteger()
1515 DE_ASSERT(ContainerStack_getTop(&log->containerStack) == CONTAINERTYPE_SAMPLE); in qpTestLog_writeValueInteger()
1517 if (!qpXmlWriter_writeStringElement(log->writer, "Value", &tmpString[0])) in qpTestLog_writeValueInteger()
1520 deMutex_unlock(log->lock); in qpTestLog_writeValueInteger()
1524 deMutex_unlock(log->lock); in qpTestLog_writeValueInteger()
1528 deBool qpTestLog_endSample (qpTestLog* log) in qpTestLog_endSample() argument
1530 DE_ASSERT(log); in qpTestLog_endSample()
1531 deMutex_lock(log->lock); in qpTestLog_endSample()
1533 if (!qpXmlWriter_endElement(log->writer, "Sample")) in qpTestLog_endSample()
1536 deMutex_unlock(log->lock); in qpTestLog_endSample()
1540 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SAMPLE); in qpTestLog_endSample()
1542 deMutex_unlock(log->lock); in qpTestLog_endSample()
1546 deBool qpTestLog_endSampleList (qpTestLog* log) in qpTestLog_endSampleList() argument
1548 DE_ASSERT(log); in qpTestLog_endSampleList()
1549 deMutex_lock(log->lock); in qpTestLog_endSampleList()
1551 if (!qpXmlWriter_endElement(log->writer, "SampleList")) in qpTestLog_endSampleList()
1554 deMutex_unlock(log->lock); in qpTestLog_endSampleList()
1558 DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SAMPLELIST); in qpTestLog_endSampleList()
1560 deMutex_unlock(log->lock); in qpTestLog_endSampleList()
1564 deBool qpTestLog_writeRaw(qpTestLog* log, const char* rawContents) in qpTestLog_writeRaw() argument
1566 DE_ASSERT(log); in qpTestLog_writeRaw()
1568 fseek(log->outputFile, 0, SEEK_END); in qpTestLog_writeRaw()
1569 fprintf(log->outputFile, "%s", rawContents); in qpTestLog_writeRaw()
1570 if (!(log->flags & QP_TEST_LOG_NO_FLUSH)) in qpTestLog_writeRaw()
1571 qpTestLog_flushFile(log); in qpTestLog_writeRaw()
1576 deUint32 qpTestLog_getLogFlags (const qpTestLog* log) in qpTestLog_getLogFlags() argument
1578 DE_ASSERT(log); in qpTestLog_getLogFlags()
1579 return log->flags; in qpTestLog_getLogFlags()
1587 deBool qpTestLog_isCompact(qpTestLog *log) in qpTestLog_isCompact() argument
1589 return (log->flags & QP_TEST_LOG_COMPACT) != 0; in qpTestLog_isCompact()