Command line parameters are written to .qpa file in sessionInfo section.
Components: Framework
VK-GL-CTS issue: 1666
Change-Id: If8fb1ce85408141362f046c318016039e06e228a
std::string releaseName;
std::string releaseId;
std::string targetName;
+ std::string qpaCommandLineParameters;
// Produced by Candy.
std::string candyTargetName;
m_sessionInfo.resultName = value;
else if (deStringEqual(attribute, "timestamp"))
m_sessionInfo.timestamp = value;
+ else if (deStringEqual(attribute, "commandLineParameters"))
+ m_sessionInfo.qpaCommandLineParameters = value;
// \todo [2012-06-09 pyry] What to do with unknown/duplicate attributes? Currently just ignored.
break;
// TestLog
-TestLog::TestLog (const char* fileName, deUint32 flags)
- : m_log(qpTestLog_createFileLog(fileName, flags))
+TestLog::TestLog (const char* fileName, int argc, char** argv, deUint32 flags)
+ : m_log(qpTestLog_createFileLog(fileName, argc, argv, flags))
{
if (!m_log)
throw ResourceError(std::string("Failed to open test log file '") + fileName + "'");
typedef LogNumber<float> Float;
typedef LogNumber<deInt64> Integer;
- explicit TestLog (const char* fileName, deUint32 flags = 0);
+ explicit TestLog (const char* fileName, int argc = 0, char** argv = DE_NULL, deUint32 flags = 0);
~TestLog (void);
MessageBuilder operator<< (const BeginMessageToken&);
{
tcu::CommandLine cmdLine (argc, argv);
tcu::DirArchive archive (".");
- tcu::TestLog log (cmdLine.getLogFileName(), cmdLine.getLogFlags());
+ tcu::TestLog log (cmdLine.getLogFileName(), argc-1, argv+1, cmdLine.getLogFlags());
de::UniquePtr<tcu::Platform> platform (createPlatform());
de::UniquePtr<tcu::App> app (new tcu::App(*platform, archive, log, cmdLine));
deSprintf(buf, bufSize, "%f", value);
}
-static deBool beginSession (qpTestLog* log)
+static deBool beginSession (qpTestLog* log, int argc, char** argv)
{
DE_ASSERT(log && !log->isSessionOpen);
fprintf(log->outputFile, "#sessionInfo releaseName %s\n", qpGetReleaseName());
fprintf(log->outputFile, "#sessionInfo releaseId 0x%08x\n", qpGetReleaseId());
fprintf(log->outputFile, "#sessionInfo targetName \"%s\"\n", qpGetTargetName());
+ fprintf(log->outputFile, "#sessionInfo commandLineParameters \"");
+ for (int i = 0; i < argc && argv != NULL; ++i)
+ {
+ fprintf(log->outputFile, "%s", argv[i]);
+ if (i < argc-1)
+ fprintf(log->outputFile, " ");
+ }
+ fprintf(log->outputFile, "\"\n");
/* Write out #beginSession. */
fprintf(log->outputFile, "#beginSession\n");
* \param fileName Name of the file where to put logs
* \return qpTestLog instance, or DE_NULL if cannot create file
*//*--------------------------------------------------------------------*/
-qpTestLog* qpTestLog_createFileLog (const char* fileName, deUint32 flags)
+qpTestLog* qpTestLog_createFileLog (const char* fileName, int argc, char** argv, deUint32 flags)
{
qpTestLog* log = (qpTestLog*)deCalloc(sizeof(qpTestLog));
if (!log)
return DE_NULL;
}
- beginSession(log);
+ beginSession(log, argc, argv);
return log;
}
} qpEglConfigInfo;
-qpTestLog* qpTestLog_createFileLog (const char* fileName, deUint32 flags);
+qpTestLog* qpTestLog_createFileLog (const char* fileName, int argc, char** argv, deUint32 flags);
void qpTestLog_destroy (qpTestLog* log);
deBool qpTestLog_startCase (qpTestLog* log, const char* testCasePath, qpTestCaseType testCaseType);