Browse Source

1、新增变量,以下划线开头,表示该变量不属于返回值,而是属于自定义添加的变量,用于保存所需信息;

scbc.sat2 5 năm trước cách đây
mục cha
commit
f1f0676943
3 tập tin đã thay đổi với 35 bổ sung4 xóa
  1. 1 1
      SATHTTP/SATHTTP/CurlClient.cpp
  2. 4 1
      SATHTTP/SATHTTP/SATHTTP.cpp
  3. 30 2
      SATHTTP/SATHTTP/SATHTTP.h

+ 1 - 1
SATHTTP/SATHTTP/CurlClient.cpp

@@ -5,7 +5,7 @@
 
 CCurlClient::CCurlClient(void)
 {
-	m_bDebug = TRUE;
+	m_bDebug = FALSE;
 	m_headers = NULL;
 }
 

+ 4 - 1
SATHTTP/SATHTTP/SATHTTP.cpp

@@ -923,6 +923,8 @@ SATHTTP_API int DownloadScript(std::string url, std::string strCaseId, std::stri
 										strPath += strFileDir.c_str();
 										strPath.Replace('/', '\\');
 										strSaveDir = strPath.GetString();
+										// 保存目录;
+										stScriptUrlResp._strFileDir = strSaveDir;
 										strSaveDir.append("\\"+strFileName);
 										// 创建目录;
 										if ( MKDIR(strSaveDir.c_str()) )
@@ -930,7 +932,8 @@ SATHTTP_API int DownloadScript(std::string url, std::string strCaseId, std::stri
 											// 同时下载脚本目录到指定目录中;
 											if ( curl.Download(stScriptUrlResp.strURL, strSaveDir, 10000) )
 											{
-												stScriptUrlResp.strScripFile = strSaveDir;
+												stScriptUrlResp._strFileName = strFileName.substr(0, strFileName.find_first_of('.'));
+												stScriptUrlResp._strScripFile = strSaveDir;
 												// 释放内存;
 												cJSON_Delete(pRoot);
 												// 返回结果;

+ 30 - 2
SATHTTP/SATHTTP/SATHTTP.h

@@ -105,12 +105,28 @@ namespace SATParameters{
 	}STHeartbeatReq, *pSTHeartbeatReq;
 
 	typedef struct __ST_CASE__
-	{
+	{		
 		std::string strIndex;
 		std::string strCaseName;
 		std::string strMainFilePath;
 		std::string strId;
 		std::string strCaseType;
+		// 执行器对象;
+		void *_pExcutor;
+		// 执行状态;
+		int _nExecutionState;
+		// 脚本保存路径;
+		std::string _strFileDir;
+		std::string _strFileName;	// 脚本文件名;
+		std::string _strScriptPath;
+		// 执行开始时间;
+		ULONGLONG _ulStartTickCount;
+		__ST_CASE__()
+		{
+			_pExcutor = NULL;
+			// 0表示未执行;1表示执行中;2表示执行完毕;3表示超时中断;
+			_nExecutionState = 0;
+		}
 	}STCase, *pSTCase;
 
 	typedef struct __ST_JOB__
@@ -158,6 +174,8 @@ namespace SATParameters{
 
 	typedef struct __ST_TASK__
 	{
+		// 任务Case用例是否支持并发;
+		bool _bConcurrent; 
 		std::string strInstanceName;
 		std::string strExecutionStatus;
 		std::string strInstanceType;
@@ -170,6 +188,8 @@ namespace SATParameters{
 		std::string strTaskType;
 		int nInstanceId;
 		std::string strProgress;
+		// 任务执行状态;
+		int _nExecutionState;
 		std::string strStartTime;
 		std::string strStopTime;
 		std::string strTaskName;
@@ -177,6 +197,12 @@ namespace SATParameters{
 		int fd;
 		int nTaskId;
 		STJob Job;
+		__ST_TASK__()
+		{
+			_bConcurrent = false;
+			// 0表示未执行;1表示执行中;2表示执行完毕;
+			_nExecutionState = 0;
+		}
 	}STTask, *pSTTask;
 
 	// SAT心跳返回结果;
@@ -258,7 +284,9 @@ namespace SATParameters{
 		std::string strMessage;
 		std::string strProjectId;	
 		// 脚本保存路径;
-		std::string strScripFile;
+		std::string _strFileDir;	// 脚本子目录;
+		std::string _strFileName;	// 脚本文件名;
+		std::string _strScripFile;	// 完成的本地脚本保存目录;
 	}STScriptUrlResp,*pSTScriptUrlResp;
 
 	//////////////////////////////////////////////////////////////////////////