mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-18 17:23:16 +00:00
updated selftest mode to pass parameters
This commit is contained in:
@@ -3640,6 +3640,19 @@ void MeshServer_Agent_SelfTest(MeshAgentHostContainer *agent)
|
||||
//int CoreModuleTesterLen = ILibSimpleDataStore_Get(agent->masterDb, "CoreModuleTester", NULL, 0);
|
||||
//char *CoreModule, *CoreModuleTester;
|
||||
|
||||
char *argarray;
|
||||
size_t argarrayLen;
|
||||
|
||||
argarrayLen = (size_t)ILibSimpleDataStore_Cached_GetJSONEx(agent->masterDb, NULL, 0);
|
||||
ILibMemory_AllocateRaw(argarray, argarrayLen);
|
||||
ILibSimpleDataStore_Cached_GetJSONEx(agent->masterDb, argarray, (int)argarrayLen);
|
||||
|
||||
duk_push_heapptr(agent->meshCoreCtx, ILibDuktape_GetProcessObject(agent->meshCoreCtx)); // [process]
|
||||
duk_push_string(agent->meshCoreCtx, argarray); // [process][string]
|
||||
duk_json_decode(agent->meshCoreCtx, -1); // [process][json]
|
||||
duk_put_prop_string(agent->meshCoreCtx, -2, "\xFF_argArray"); // [process]
|
||||
duk_pop(agent->meshCoreCtx);
|
||||
|
||||
printf("Agent Self Test...\n");
|
||||
if (agent->coreTimeout != 0)
|
||||
{
|
||||
|
||||
@@ -75,6 +75,11 @@ function coreInfo()
|
||||
console.log(' ' + J.osdesc);
|
||||
console.log(' ' + J.value);
|
||||
console.log('');
|
||||
if (process.argv.includes('--showCoreInfo="1"'))
|
||||
{
|
||||
console.log('\n' + JSON.stringify(J) + '\n');
|
||||
}
|
||||
|
||||
handler.promise._res();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user