当前位置: 首页>>代码示例>>C++>>正文


C++ TestObject::getStdOutFileName方法代码示例

本文整理汇总了C++中TestObject::getStdOutFileName方法的典型用法代码示例。如果您正苦于以下问题:C++ TestObject::getStdOutFileName方法的具体用法?C++ TestObject::getStdOutFileName怎么用?C++ TestObject::getStdOutFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestObject的用法示例。


在下文中一共展示了TestObject::getStdOutFileName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: processCMDCLEAN_REQUEST

void AgentThread::processCMDCLEAN_REQUEST(int socketHandle)
{
  try {
	ConsoleServer::debugMsg(1,"Processing CMDCLEAN_REQUEST\n");
	// read the serialized TestObject which we will stop
	TestObject test;
	
	test.readTestObject(socketHandle);
	// now send a signal indicating we are processing the request
	Utils::sendSignal(socketHandle,RESPONSE_PROCESSING);
		
	//clean the files now
	for (int i = 0; i < getProcessCount(); i++) {
	  // check for any instance of test running with the same id
	  TestObject *curr = getProcess(i)->getTestObject();		  
	  if (curr->getTestID().compare(test.getTestID())==0) {
		// clean up the trace files
		ConsoleServer::debugMsg(1,
								"Cleaning environment file :%s\n",
								curr->getEnvFileName().c_str());
		if (Utils::delete_file(curr->getEnvFileName())!=0)
		  ConsoleServer::debugMsg(1,"No environment file was found :%s\n",
								  curr->getEnvFileName().c_str());
		ConsoleServer::debugMsg(1,"Cleaning stdout file :%s\n",
								curr->getStdOutFileName().c_str());
		if (Utils::delete_file(curr->getStdOutFileName())!=0)
		  ConsoleServer::debugMsg(1,"No stdout file was found :%s\n",
								  curr->getStdOutFileName().c_str());
		ConsoleServer::debugMsg(1,"Cleaning stderr file :%s\n",
								curr->getStdErrFileName().c_str());
		if (Utils::delete_file(curr->getStdErrFileName())!=0)
		  ConsoleServer::debugMsg(1,"No stderr file was found :%s\n",
								  curr->getStdErrFileName().c_str());
		
		// remove from our list of test objects
		ConsoleServer::debugMsg(1,"Removing process from process pool\n");
		
		delProcess(i);						
		
		break;
	  }
	}
		
	// now send a signal indicating we have finished
	Utils::sendSignal(socketHandle,RESPONSE_FINISHED_OK);
  }
  catch (char * message) {
	ConsoleServer::debugMsg(1,"Error processing CMDCLEAN_REQUEST request:%s\n",message);
	Utils::sendSignal(socketHandle,RESPONSE_FINISHED_ERROR);
  }
};	
开发者ID:dineshkummarc,项目名称:qat-2.7.1-src,代码行数:51,代码来源:AgentThread.cpp

示例2: processGETTRACEPATHS_REQUEST

void AgentThread::processGETTRACEPATHS_REQUEST(int socketHandle) 
{
  try {
	ConsoleServer::debugMsg(1,"Processing GETTRACEPATHS_REQUEST\n");
	// read the serialized TestObject which we want the exit code of
	TestObject test;
	
	test.readTestObject(socketHandle);
	// now send a signal indicating we are processing the request
	Utils::sendSignal(socketHandle,RESPONSE_PROCESSING);
	int wasRun = FALSE;			
	for (int i = 0; i < getProcessCount(); i++) {
	  // check for any instance of test running with the same id
	  TestObject *curr = getProcess(i)->getTestObject();		  
	  if (curr->getTestID().compare(test.getTestID())==0) {
		wasRun = true;
		Utils::sendSignal(socketHandle,RESPONSE_FINISHED_OK);
		ConsoleServer::debugMsg(9,"Sending trace file paths\n");
		ConsoleServer::debugMsg(9,"Env file    :%s\n",curr->getEnvFileName().c_str());		
		ConsoleServer::debugMsg(9,"StdOut file :%s\n",curr->getStdOutFileName().c_str());		
		ConsoleServer::debugMsg(9,"StdErr file :%s\n",curr->getStdErrFileName().c_str());
		
		// ---- send the env, stdout and stderr files --------------------
		Utils::writeString(socketHandle,curr->getEnvFileName());
		Utils::writeString(socketHandle,curr->getStdOutFileName());
		Utils::writeString(socketHandle,curr->getStdErrFileName());	
		// ----------------------------------
		break;
	  }
	}
	
	if (!wasRun) {
	  // the process was never started, so assume it failed
	  ConsoleServer::debugMsg(1,"Process was never started :%s\n",test.getTestID().c_str());			
	  Utils::writeInt(socketHandle,RESPONSE_FINISHED_ERROR);
	}
	else {
	  // now send a signal indicating we have finished
	  Utils::sendSignal(socketHandle,RESPONSE_FINISHED_OK);
	}
	
  }
  catch (char *message) {
	ConsoleServer::debugMsg(1,"Error processing GETTRACEPATHS_REQUEST request:%s\n",message);
	Utils::sendSignal(socketHandle,RESPONSE_FINISHED_ERROR);
  }  
}
开发者ID:dineshkummarc,项目名称:qat-2.7.1-src,代码行数:47,代码来源:AgentThread.cpp


注:本文中的TestObject::getStdOutFileName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。