Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove the complexity needed to save a global that is never used
[simgrid.git] / tools / tesh / tesh.c
index 34c92b1..f23c3be 100644 (file)
@@ -22,6 +22,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(tesh, "TEst SHell utility");
 int timeout_value = 5;          /* child timeout value */
 int sort_len = 19;              /* length of the prefix to sort */
 char *option;
+int coverage = 0;                              /* whether the code coverage is enable */
 
 rctx_t rctx;
 const char *testsuite_name;
@@ -171,8 +172,7 @@ static void handle_suite(const char *filename, FILE * IN)
   rctx_free(rctx);
 
   /* Clear buffers */
-  if (line)
-    free(line);
+  free(line);
   xbt_strbuff_free(buff);
 
 }
@@ -255,6 +255,13 @@ int main(int argc, char *argv[])
       argc -= 2;
       i -= 2;
     }
+    else if (!strcmp(argv[i], "--enable-coverage" )){
+       coverage = 1;
+       XBT_INFO("Enable coverage");
+       memmove(argv + i, argv + i + 1, (argc - i - 1) * sizeof(char *));
+       argc -= 1;
+       i -= 1;
+    }
   }
 
   /* Find the description file */