TD-2808
This commit is contained in:
parent
29394ec81f
commit
34efc16820
|
@ -20,6 +20,7 @@
|
||||||
#undef TAOS_MEM_CHECK
|
#undef TAOS_MEM_CHECK
|
||||||
|
|
||||||
bool simAsyncQuery = false;
|
bool simAsyncQuery = false;
|
||||||
|
bool simExecSuccess = false;
|
||||||
|
|
||||||
void simHandleSignal(int32_t signo) {
|
void simHandleSignal(int32_t signo) {
|
||||||
simSystemCleanUp();
|
simSystemCleanUp();
|
||||||
|
@ -62,5 +63,8 @@ int32_t main(int32_t argc, char *argv[]) {
|
||||||
simScriptList[++simScriptPos] = script;
|
simScriptList[++simScriptPos] = script;
|
||||||
simExecuteScript(script);
|
simExecuteScript(script);
|
||||||
|
|
||||||
return 0;
|
int32_t ret = simExecSuccess ? 0 : -1;
|
||||||
|
simError("execute result %d", ret);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
|
@ -21,6 +21,7 @@
|
||||||
#include "ttimer.h"
|
#include "ttimer.h"
|
||||||
#include "tutil.h"
|
#include "tutil.h"
|
||||||
#include "tsocket.h"
|
#include "tsocket.h"
|
||||||
|
#include "taoserror.h"
|
||||||
#undef TAOS_MEM_CHECK
|
#undef TAOS_MEM_CHECK
|
||||||
|
|
||||||
SScript *simScriptList[MAX_MAIN_SCRIPT_NUM];
|
SScript *simScriptList[MAX_MAIN_SCRIPT_NUM];
|
||||||
|
@ -31,6 +32,8 @@ int32_t simDebugFlag = 135;
|
||||||
void simCloseTaosdConnect(SScript *script);
|
void simCloseTaosdConnect(SScript *script);
|
||||||
char simHostName[128];
|
char simHostName[128];
|
||||||
|
|
||||||
|
extern bool simExecSuccess;
|
||||||
|
|
||||||
char *simParseArbitratorName(char *varName) {
|
char *simParseArbitratorName(char *varName) {
|
||||||
static char hostName[140];
|
static char hostName[140];
|
||||||
sprintf(hostName, "%s:%d", simHostName, 8000);
|
sprintf(hostName, "%s:%d", simHostName, 8000);
|
||||||
|
@ -118,10 +121,12 @@ SScript *simProcessCallOver(SScript *script) {
|
||||||
if (script->type == SIM_SCRIPT_TYPE_MAIN) {
|
if (script->type == SIM_SCRIPT_TYPE_MAIN) {
|
||||||
simDebug("script:%s, is main script, set stop flag", script->fileName);
|
simDebug("script:%s, is main script, set stop flag", script->fileName);
|
||||||
if (script->killed) {
|
if (script->killed) {
|
||||||
|
simExecSuccess = false;
|
||||||
simInfo("script:" FAILED_PREFIX "%s" FAILED_POSTFIX ", " FAILED_PREFIX "failed" FAILED_POSTFIX ", error:%s",
|
simInfo("script:" FAILED_PREFIX "%s" FAILED_POSTFIX ", " FAILED_PREFIX "failed" FAILED_POSTFIX ", error:%s",
|
||||||
script->fileName, script->error);
|
script->fileName, script->error);
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
|
simExecSuccess = true;
|
||||||
simInfo("script:" SUCCESS_PREFIX "%s" SUCCESS_POSTFIX ", " SUCCESS_PREFIX "success" SUCCESS_POSTFIX,
|
simInfo("script:" SUCCESS_PREFIX "%s" SUCCESS_POSTFIX ", " SUCCESS_PREFIX "success" SUCCESS_POSTFIX,
|
||||||
script->fileName);
|
script->fileName);
|
||||||
simCloseTaosdConnect(script);
|
simCloseTaosdConnect(script);
|
||||||
|
|
Loading…
Reference in New Issue