--deqp-vk-device-id=<value>
+To speed up the conformance run on some platforms the following command line
+option may be used to disable frequent fflush() calls to the output logs:
+
+ --deqp-log-flush=disable
+
No other command line options are allowed.
### Win32
DE_DECLARE_COMMAND_LINE_OPT(LogShaderSources, bool);
DE_DECLARE_COMMAND_LINE_OPT(TestOOM, bool);
DE_DECLARE_COMMAND_LINE_OPT(VKDeviceID, int);
+DE_DECLARE_COMMAND_LINE_OPT(LogFlush, bool);
static void parseIntList (const char* src, std::vector<int>* dst)
{
<< Option<VKDeviceID> (DE_NULL, "deqp-vk-device-id", "Vulkan device ID (IDs start from 1)", "1")
<< Option<LogImages> (DE_NULL, "deqp-log-images", "Enable or disable logging of result images", s_enableNames, "enable")
<< Option<LogShaderSources> (DE_NULL, "deqp-log-shader-sources", "Enable or disable logging of shader sources", s_enableNames, "enable")
- << Option<TestOOM> (DE_NULL, "deqp-test-oom", "Run tests that exhaust memory on purpose", s_enableNames, TEST_OOM_DEFAULT);
+ << Option<TestOOM> (DE_NULL, "deqp-test-oom", "Run tests that exhaust memory on purpose", s_enableNames, TEST_OOM_DEFAULT)
+ << Option<LogFlush> (DE_NULL, "deqp-log-flush", "Enable or disable log file fflush", s_enableNames, "enable");
}
void registerLegacyOptions (de::cmdline::Parser& parser)
if (!m_cmdLine.getOption<opt::LogShaderSources>())
m_logFlags |= QP_TEST_LOG_EXCLUDE_SHADER_SOURCES;
+ if (!m_cmdLine.getOption<opt::LogFlush>())
+ m_logFlags |= QP_TEST_LOG_NO_FLUSH;
+
if ((m_cmdLine.hasOption<opt::CasePath>()?1:0) +
(m_cmdLine.hasOption<opt::CaseList>()?1:0) +
(m_cmdLine.hasOption<opt::CaseListFile>()?1:0) +
if (!file)
throw Exception("Failed to open " + filename);
- writer = qpXmlWriter_createFileWriter(file, DE_FALSE);
+ writer = qpXmlWriter_createFileWriter(file, DE_FALSE, DE_FALSE);
if (!writer)
throw Exception("XML writer creation failed");
}
log->flags = flags;
- log->writer = qpXmlWriter_createFileWriter(log->outputFile, 0);
+ log->writer = qpXmlWriter_createFileWriter(log->outputFile, 0, !(flags & QP_TEST_LOG_NO_FLUSH));
log->lock = deMutex_create(DE_NULL);
log->isSessionOpen = DE_FALSE;
log->isCaseOpen = DE_FALSE;
/* Flush XML and write out #beginTestCaseResult. */
qpXmlWriter_flush(log->writer);
fprintf(log->outputFile, "\n#beginTestCaseResult %s\n", testCasePath);
- qpTestLog_flushFile(log);
+ if (!(log->flags & QP_TEST_LOG_NO_FLUSH))
+ qpTestLog_flushFile(log);
log->isCaseOpen = DE_TRUE;
/* Flush XML and write #endTestCaseResult. */
qpXmlWriter_flush(log->writer);
fprintf(log->outputFile, "\n#endTestCaseResult\n");
- qpTestLog_flushFile(log);
+ if (!(log->flags & QP_TEST_LOG_NO_FLUSH))
+ qpTestLog_flushFile(log);
log->isCaseOpen = DE_FALSE;
typedef enum qpTestLogFlag_e
{
QP_TEST_LOG_EXCLUDE_IMAGES = (1<<0), /*!< Do not log images. This reduces log size considerably. */
- QP_TEST_LOG_EXCLUDE_SHADER_SOURCES = (1<<1) /*!< Do not log shader sources. Helps to reduce log size further. */
+ QP_TEST_LOG_EXCLUDE_SHADER_SOURCES = (1<<1), /*!< Do not log shader sources. Helps to reduce log size further. */
+ QP_TEST_LOG_NO_FLUSH = (1<<2) /*!< Do not do a fflush after writing the log. */
} qpTestLogFlag;
/* Shader type. */
struct qpXmlWriter_s
{
FILE* outputFile;
+ deBool flushAfterWrite;
deBool xmlPrevIsStartElement;
deBool xmlIsWriting;
}
} while (!isEOS);
- fflush(writer->outputFile);
+ if (writer->flushAfterWrite)
+ fflush(writer->outputFile);
DE_ASSERT(d == &buf[0]); /* buffer must be empty */
return DE_TRUE;
}
-qpXmlWriter* qpXmlWriter_createFileWriter (FILE* outputFile, deBool useCompression)
+qpXmlWriter* qpXmlWriter_createFileWriter (FILE* outputFile, deBool useCompression, deBool flushAfterWrite)
{
qpXmlWriter* writer = (qpXmlWriter*)deCalloc(sizeof(qpXmlWriter));
if (!writer)
DE_UNREF(useCompression); /* no compression supported. */
writer->outputFile = outputFile;
+ writer->flushAfterWrite = flushAfterWrite;
return writer;
}
* \brief Create a file based XML Writer instance
* \param fileName Name of the file
* \param useCompression Set to DE_TRUE to use compression, if supported by implementation
+ * \param flushAfterWrite Set to DE_TRUE to call fflush after writing each XML token
* \return qpXmlWriter instance, or DE_NULL if cannot create file
*//*--------------------------------------------------------------------*/
-qpXmlWriter* qpXmlWriter_createFileWriter (FILE* outFile, deBool useCompression);
+qpXmlWriter* qpXmlWriter_createFileWriter (FILE* outFile, deBool useCompression, deBool flushAfterWrite);
/*--------------------------------------------------------------------*//*!
* \brief XML Writer instance