- print "USAGE: $progname [--root=part/to/cut] [--path=where/to/search NOT WORKING] [--outdir=where/to/generate/files] infile [infile+]\n";
+ print "USAGE: $progname [--root=part/to/cut] [--outdir=where/to/generate/files] infile [infile+]\n\n";
+ print "This program is in charge of extracting the unit tests out of the SimGrid source code.\n";
+ print "See http://simgrid.gforge.inria.fr/doc/latest/inside_tests.html for more details.\n";
open OUT,">${outdir}simgrid_units_main.c" || die "$progname: Cannot open main file '${outdir}simgrid_units_main.c': $!\n";
print OUT $GENERATED;
print OUT "#include <stdio.h>\n\n";
open OUT,">${outdir}simgrid_units_main.c" || die "$progname: Cannot open main file '${outdir}simgrid_units_main.c': $!\n";
print OUT $GENERATED;
print OUT "#include <stdio.h>\n\n";
print OUT "#include \"xbt.h\"\n\n";
print OUT "extern xbt_test_unit_t _xbt_current_unit;\n\n";
print OUT "/* SGU: BEGIN PROTOTYPES */\n";
print OUT "#include \"xbt.h\"\n\n";
print OUT "extern xbt_test_unit_t _xbt_current_unit;\n\n";
print OUT "/* SGU: BEGIN PROTOTYPES */\n";
if (!strncmp(argv[i],\"--tests=\",strlen(\"--tests=\"))) {
char *p=strchr(argv[i],'=')+1;
if (selection[0] == '\\0') {
if (!strncmp(argv[i],\"--tests=\",strlen(\"--tests=\"))) {
char *p=strchr(argv[i],'=')+1;
if (selection[0] == '\\0') {
- strcat(selection, \",\");
- strcat(selection, p);
+ strncat(selection, \",\",1);
+ strncat(selection, p, 1023);