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;
rctx_free(rctx);
/* Clear buffers */
- if (line)
- free(line);
+ free(line);
xbt_strbuff_free(buff);
}
XBT_ERROR("--cfg argument requires an argument");
exit(1);
}
- if(!option){ //if option is NULL
+ if (!option){ //if option is NULL
option = bprintf("--cfg=%s",argv[i+1]);
- }else{
- option = bprintf("%s --cfg=%s",option,argv[i+1]);
+ } else {
+ char *newoption = bprintf("%s --cfg=%s", option, argv[i+1]);
+ free(option);
+ option = newoption;
}
XBT_INFO("Add option \'--cfg=%s\' to command line",argv[i+1]);
memmove(argv + i, argv + i + 2, (argc - i - 1) * sizeof(char *));
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 */
rctx_exit();
xbt_dict_free(&env);
- xbt_free_f(option);
+ free(option);
return 0;
}