X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/41acb535492710d42da81b0878fa602bdeaa4bd5..efd201684c340bfd7508b656bdbc59f57e7e7c67:/tools/tesh/tesh.c diff --git a/tools/tesh/tesh.c b/tools/tesh/tesh.c index e441b89701..f23c3be90b 100644 --- a/tools/tesh/tesh.c +++ b/tools/tesh/tesh.c @@ -21,8 +21,14 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(tesh, "TEst SHell utility"); /*** Options ***/ 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; + +xbt_dict_t env; + static void handle_line(const char *filepos, char *line) { /* Search end */ @@ -166,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); } @@ -227,7 +232,7 @@ int main(int argc, char *argv[]) exit(1); } char *eq = strchr(argv[i+1], '='); - xbt_assert1(eq,"The argument of --setenv must contain a '=' (got %s instead)",argv[i+1]); + xbt_assert(eq,"The argument of --setenv must contain a '=' (got %s instead)",argv[i+1]); char *key = bprintf("%.*s", (int) (eq - argv[i+1]), argv[i+1]); xbt_dict_set(env, key, xbt_strdup(eq + 1), xbt_free_f); XBT_INFO("setting environment variable '%s' to '%s'", key, eq+1); @@ -250,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 */