|
@@ -835,6 +835,36 @@ bool CSATExecutor::GetCaseXMLResult(std::string xmlpath, std::vector<STCaseItem>
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+int CSATExecutor::AttachTaskInfo2Buffer(SATPROTO::TaskInfo (&pbuff)[SATPROTO::MAX_TASKS])
|
|
|
|
+{
|
|
|
|
+ int count = 0;
|
|
|
|
+ if ( pbuff ) {
|
|
|
|
+ AutoThreadSection ats(&m_csTask);
|
|
|
|
+ std::list<SATHTTP::STTask>::iterator it = m_vtTask.begin();
|
|
|
|
+ for ( ;it != m_vtTask.end(); it++ ) {
|
|
|
|
+ pbuff[count].nStatus = it->_nExecutionState;
|
|
|
|
+ pbuff[count].nTaskId = it->Id;
|
|
|
|
+ memcpy_s(pbuff[count].szTaskNo, SATPROTO::MAX_NAME, it->Job.strUniqueId.c_str(), it->Job.strUniqueId.size());
|
|
|
|
+ memcpy_s(pbuff[count].szTaskName, SATPROTO::MAX_NAME, it->strTaskName.c_str(), it->strTaskName.size());
|
|
|
|
+
|
|
|
|
+ int nIndex = 0;
|
|
|
|
+ for (std::vector<SATHTTP::STCase>::iterator _case = it->Job.vtCases.begin(); _case != it->Job.vtCases.end(); _case++) {
|
|
|
|
+ pbuff[count].ssCases[nIndex].nStatus = _case->_nExecutionState;
|
|
|
|
+ //pbuff[count].ssCases[nIndex].nCaseId = _case->_nCaseStep;
|
|
|
|
+ memcpy_s(pbuff[count].ssCases[nIndex].szCaseName, SATPROTO::MAX_NAME, _case->strCaseName.c_str(), _case->strCaseName.size());
|
|
|
|
+ nIndex++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ count++;
|
|
|
|
+ // ³¬¹ýMAX_TASKSÍ˳ö;
|
|
|
|
+ if ( count == SATPROTO::MAX_TASKS )
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return count;
|
|
|
|
+}
|
|
|
|
+
|
|
void CSATExecutor::StartWork()
|
|
void CSATExecutor::StartWork()
|
|
{
|
|
{
|
|
m_hEventHearbeat = CreateEvent(NULL, TRUE, FALSE, NULL);
|
|
m_hEventHearbeat = CreateEvent(NULL, TRUE, FALSE, NULL);
|
|
@@ -1076,4 +1106,4 @@ DWORD CSATExecutor::ExecuteScriptThread(LPVOID lpVoid)
|
|
} while ( WaitForSingleObject(that->m_hEventExcuteScript, 10000) == WAIT_TIMEOUT );
|
|
} while ( WaitForSingleObject(that->m_hEventExcuteScript, 10000) == WAIT_TIMEOUT );
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
-}
|
|
|
|
|
|
+}
|