|
@@ -92,32 +92,31 @@ SATParameters::STCase* CSATExecutor::GetFreeCaseScript(std::vector<SATParameters
|
|
|
SATParameters::STCase* CSATExecutor::ExecuteFreeCaseScript(SATParameters::STTask* pTask)
|
|
|
{
|
|
|
SATParameters::STCase* pCase = GetFreeCaseScript(pTask->Job.vtCases);
|
|
|
- if (pCase)
|
|
|
- {
|
|
|
- if ( !pCase->_pExcutor )
|
|
|
- {
|
|
|
- CScriptExecutor *pExcutor = new CScriptExecutor();
|
|
|
- if ( pExcutor )
|
|
|
- {
|
|
|
+ if (pCase) {
|
|
|
+ if ( !pCase->_pExcutor ) {
|
|
|
+ CScriptExecutor *pExcutor = new CScriptExecutor();
|
|
|
+ if ( pExcutor ) {
|
|
|
pCase->_pExcutor = pExcutor;
|
|
|
// 用例的日志文件路径;
|
|
|
pCase->_strCaseLog = pCase->_strFileDir + "\\" + pCase->_strFileName + ".txt";
|
|
|
- if ( pExcutor->InitScript(pCase->_strScriptPath, pCase->_strCaseLog, "", SUBPROCESS) )
|
|
|
- {
|
|
|
+ if ( pExcutor->InitScript(pCase->_strScriptPath, pCase->_strCaseLog, "", SUBPROCESS) ) {
|
|
|
pExcutor->StartScript();
|
|
|
// 标记用例执行中;
|
|
|
pCase->_nExecutionState = 1;
|
|
|
- // 标记任务为执行中;
|
|
|
- pTask->_nExecutionState = 1;
|
|
|
- // 记录开始时间;
|
|
|
- pCase->_ulStartTickCount = GetTickCount64();
|
|
|
- pCase->_strStartTime = CTime::GetCurrentTime().Format(_T("%Y-%m-%d %H:%M:%S"));
|
|
|
}
|
|
|
+ else { // 初始化失败;
|
|
|
+ pCase->_nExecutionState = 4;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 标记任务为执行中;
|
|
|
+ pTask->_nExecutionState = 1;
|
|
|
+ // 记录开始时间;
|
|
|
+ pCase->_ulStartTickCount = GetTickCount64();
|
|
|
+ pCase->_strStartTime = CTime::GetCurrentTime().Format(_T("%Y-%m-%d %H:%M:%S"));
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- CScriptExecutor *pExcutor = (CScriptExecutor *)pCase->_pExcutor;
|
|
|
+ else {
|
|
|
+ //CScriptExecutor *pExcutor = (CScriptExecutor *)pCase->_pExcutor;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -842,6 +841,10 @@ DWORD CSATExecutor::HearbeatThread(LPVOID lpVoid)
|
|
|
_case->_strFileName = stScriptUrlResp._strFileName;
|
|
|
_case->_strScriptPath = stScriptUrlResp._strScripFile;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OutputDebugString("下载脚本失败\n");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
that->m_vtTask.push_back(*it);
|