From ffbb3987b2904e5c55540cacc898f1d2e3e0117f Mon Sep 17 00:00:00 2001 From: cherierm Date: Tue, 19 Aug 2008 15:55:25 +0000 Subject: [PATCH] last changes of Tesh tools git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5898 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- tools/tesh2/include/types.h | 1 + tools/tesh2/src/context.c | 7 +++++++ tools/tesh2/src/fstream.c | 16 ++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/tools/tesh2/include/types.h b/tools/tesh2/include/types.h index ae5fcc4251..391313445a 100644 --- a/tools/tesh2/include/types.h +++ b/tools/tesh2/include/types.h @@ -318,6 +318,7 @@ typedef struct s_context #ifdef WIN32 char* t_command_line; /* translate the command line on Windows */ + unsigned is_not_found:1; #endif }s_context_t,* context_t; diff --git a/tools/tesh2/src/context.c b/tools/tesh2/src/context.c index 877ffc22bf..3ddd1b210e 100644 --- a/tools/tesh2/src/context.c +++ b/tools/tesh2/src/context.c @@ -37,6 +37,7 @@ context_new(void) #ifdef WIN32 context->t_command_line = NULL; + context->is_not_found = 0; #endif return context; @@ -88,6 +89,9 @@ context_reset(context_t context) free(context->t_command_line); context->t_command_line = NULL; } + + context->is_not_found = 0; + #endif if(context->pos) @@ -132,6 +136,7 @@ context_dup(context_t context) #ifdef WIN32 dup->t_command_line = strdup(context->t_command_line); + dup->is_not_found = context->is_not_found; #endif dup->exit_code = context->exit_code; @@ -187,6 +192,8 @@ context_clear(context_t context) free(context->t_command_line); context->t_command_line = NULL; } + context->is_not_found = 0; + #endif if(context->pos) diff --git a/tools/tesh2/src/fstream.c b/tools/tesh2/src/fstream.c index fb0ce0f2f0..2bbaa6ea83 100644 --- a/tools/tesh2/src/fstream.c +++ b/tools/tesh2/src/fstream.c @@ -327,7 +327,7 @@ fstream_parse(fstream_t fstream, xbt_os_mutex_t mutex) unit->is_running_suite = 0; } - if(context->command_line) + if(context->command_line && !context->is_not_found) { if(fstream_launch_command(fstream, context, mutex) < 0) break; @@ -374,7 +374,7 @@ fstream_parse(fstream_t fstream, xbt_os_mutex_t mutex) } /* Check that last command of the file ran well */ - if(context->command_line) + if(context->command_line && !context->is_not_found) { if(fstream_launch_command(fstream, context, mutex) < 0) return -1; @@ -1306,9 +1306,21 @@ fstream_process_token(fstream_t fstream, context_t context, xbt_os_mutex_t mutex if(!is_w32_cmd(command_line, fstream->unit->runner->path) && getpath(command_line, &path) < 0) { + command_t command; + ERROR3("[%s] `%s' : NOK (%s)", filepos, command_line, error_to_string(ECMDNOTFOUND, 1)); unit_set_error(fstream->unit, ECMDNOTFOUND, 1, filepos); + + context->is_not_found = 1; + + command = command_new(fstream->unit, context, mutex); + + command->status = cs_failed; + command->reason = csr_command_not_found; + failure(unit); + + return; } -- 2.20.1