X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/07c319ec54d6fc778ee3cc5e75a747242006723e..c4aa4cede2e91d6f21df5c34bb55ad8bf0207e2a:/tools/tesh/run_context.c diff --git a/tools/tesh/run_context.c b/tools/tesh/run_context.c index 41af0d5efd..b5939040b8 100644 --- a/tools/tesh/run_context.c +++ b/tools/tesh/run_context.c @@ -302,6 +302,9 @@ void rctx_pushline(const char *filepos, char kind, char *line) rctx->cmd = xbt_strdup(line); rctx->filepos = xbt_strdup(filepos); + if(option){ + rctx->cmd = bprintf("%s %s",rctx->cmd,option); + } INFO3("[%s] %s%s", filepos, rctx->cmd, ((rctx->is_background) ? " (background command)" : "")); @@ -342,6 +345,9 @@ void rctx_pushline(const char *filepos, char kind, char *line) filepos, rctx->expected_return); } else if (!strncmp(line, "output sort", strlen("output sort"))) { + sort_len = atoi(line + strlen("output sort")); + if (sort_len==0) + sort_len=SORT_LEN_DEFAULT; rctx->output_sort = 1; VERB1("[%s] (sort output of next command)", filepos); @@ -650,7 +656,7 @@ static int cmpstringp(const void *p1, const void *p2) { DEBUG2("Compare strings '%s' and '%s'", s1, s2); - int res = strncmp(s1, s2, 19); + int res = strncmp(s1, s2, sort_len); if (res == 0) return p1>p2; return res; @@ -799,7 +805,6 @@ void *rctx_wait(void *r) xbt_dynar_free(&a); /* If an empty line moved in first position, move it back to the end */ if (rctx->output_got->data[0]=='\n') { - fprintf(stderr,"XXX"); memmove(rctx->output_got->data,rctx->output_got->data+1,rctx->output_got->used-1); rctx->output_got->data[rctx->output_got->used-1] = '\n'; }