Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change cmake variable HAVE_RUBY_H to HAVE_RUBY for homogeneity with other variables
[simgrid.git] / tools / tesh2 / src / fstream.c
index 0a8ef5e..313717f 100644 (file)
@@ -329,8 +329,16 @@ fstream_parse(fstream_t fstream, xbt_os_mutex_t mutex)
                                \r
                        if(context->command_line)\r
                        {\r
+                               #ifdef WIN32\r
+                               if(!context->is_not_found)\r
+                               {\r
+                               #endif\r
                                if(fstream_launch_command(fstream, context, mutex) < 0)\r
                                                break;\r
+\r
+                               #ifdef WIN32\r
+                               }\r
+                               #endif\r
                        }\r
                \r
                        continue;\r
@@ -376,8 +384,17 @@ fstream_parse(fstream_t fstream, xbt_os_mutex_t mutex)
        /* Check that last command of the file ran well */\r
        if(context->command_line)\r
        {\r
+               #ifdef WIN32\r
+               if(!context->is_not_found)\r
+               {\r
+               #endif\r
+\r
                if(fstream_launch_command(fstream, context, mutex) < 0)\r
                        return -1;\r
+\r
+               #ifdef WIN32\r
+               }\r
+               #endif\r
        }\r
        \r
        /* clear buffers */\r
@@ -986,10 +1003,10 @@ fstream_lex_line(fstream_t fstream, context_t context, xbt_os_mutex_t mutex, con
                \r
        }\r
        \r
-       p = line2 + 2;\r
-       \r
-       while(p && 1)\r
+       while(1)\r
        {\r
+               p = line2 + (line2[0] =='<' ? 4 : 2);\r
+               \r
                if((p = strchr(p, '$')))\r
                {\r
                        if(*(p+1) != ' ')\r
@@ -1306,9 +1323,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