Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
last changes of Tesh tools
authorcherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 19 Aug 2008 15:55:25 +0000 (15:55 +0000)
committercherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 19 Aug 2008 15:55:25 +0000 (15:55 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5898 48e7efb5-ca39-0410-a469-dd3cf9ba447f

tools/tesh2/include/types.h
tools/tesh2/src/context.c
tools/tesh2/src/fstream.c

index ae5fcc42512c40ac0bf108a598e0e679838787c0..391313445ab8de36f579a507f411a8d59e3c0fb8 100644 (file)
@@ -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;
index 877ffc22bf193f8de75fcdb44d72a88d39a6e672..3ddd1b210e1ec69e3b3a4c302c7b7b734f0c2ed9 100644 (file)
@@ -37,6 +37,7 @@ context_new(void)
 \r
        #ifdef WIN32\r
        context->t_command_line = NULL;\r
+       context->is_not_found = 0;\r
        #endif\r
        \r
        return context;\r
@@ -88,6 +89,9 @@ context_reset(context_t context)
                free(context->t_command_line);\r
                context->t_command_line = NULL;\r
        }\r
+\r
+       context->is_not_found = 0;\r
+\r
        #endif\r
 \r
        if(context->pos)\r
@@ -132,6 +136,7 @@ context_dup(context_t context)
        \r
        #ifdef WIN32\r
        dup->t_command_line = strdup(context->t_command_line);\r
+       dup->is_not_found = context->is_not_found;\r
        #endif\r
 \r
        dup->exit_code = context->exit_code;\r
@@ -187,6 +192,8 @@ context_clear(context_t context)
                free(context->t_command_line);\r
                context->t_command_line = NULL;\r
        }\r
+       context->is_not_found = 0;\r
+\r
        #endif\r
 \r
        if(context->pos)\r
index fb0ce0f2f09fd1ead239840d14e4d1ee88d625f0..2bbaa6ea83d82fee6e2bf4aa56f2de87d478cdc9 100644 (file)
@@ -327,7 +327,7 @@ fstream_parse(fstream_t fstream, xbt_os_mutex_t mutex)
                                unit->is_running_suite = 0;\r
                        }\r
                                \r
-                       if(context->command_line)\r
+                       if(context->command_line && !context->is_not_found)\r
                        {\r
                                if(fstream_launch_command(fstream, context, mutex) < 0)\r
                                                break;\r
@@ -374,7 +374,7 @@ fstream_parse(fstream_t fstream, xbt_os_mutex_t mutex)
        }\r
        \r
        /* Check that last command of the file ran well */\r
-       if(context->command_line)\r
+       if(context->command_line && !context->is_not_found)\r
        {\r
                if(fstream_launch_command(fstream, context, mutex) < 0)\r
                        return -1;\r
@@ -1306,9 +1306,21 @@ fstream_process_token(fstream_t fstream, context_t context, xbt_os_mutex_t mutex
                \r
                if(!is_w32_cmd(command_line, fstream->unit->runner->path) && getpath(command_line, &path) < 0)\r
                {\r
+                       command_t command;\r
+\r
                        ERROR3("[%s] `%s' : NOK (%s)", filepos, command_line, error_to_string(ECMDNOTFOUND, 1));\r
                        unit_set_error(fstream->unit, ECMDNOTFOUND, 1, filepos);\r
+\r
+                       context->is_not_found = 1;\r
+                       \r
+                       command = command_new(fstream->unit, context, mutex);\r
+\r
+                       command->status = cs_failed;\r
+                       command->reason = csr_command_not_found;\r
+\r
                        failure(unit);\r
+                       \r
+                       \r
                        return;\r
                }\r
                \r