X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/aa9d8bfe2bf176fa6b86b7db4acbbaff8ee85292..fe2cfede6b5e1c8d2af6db841de278dfcffd8baf:/tools/sg_unit_extractor.pl diff --git a/tools/sg_unit_extractor.pl b/tools/sg_unit_extractor.pl index 657b6a966e..66ef7d7dcd 100755 --- a/tools/sg_unit_extractor.pl +++ b/tools/sg_unit_extractor.pl @@ -1,17 +1,10 @@ #! /usr/bin/perl use strict; -use Fcntl ':flock'; use strict; use Getopt::Long qw(GetOptions); -open SELF, "< $0" or die "Cannot open the lock file"; -if (!flock SELF, LOCK_EX | LOCK_NB) { - print STDERR "sg_unit_extractor already running. Cancelling...\n"; - exit; -} - my $progname="sg_unit_extractor"; # Get the args @@ -137,8 +130,10 @@ sub process_one($) { int main(int argc, char *argv[]) { xbt_test_suite_t suite; char selection[1024]; - int i;\n - int res;\n + int verbosity = 0; + int i; + int res; + /* SGU: BEGIN SUITES DECLARATION */ /* SGU: END SUITES DECLARATION */ @@ -155,14 +150,17 @@ int main(int argc, char *argv[]) { strcat(selection, \",\"); strcat(selection, p); } - } else if (!strncmp(argv[i],\"--dump-only\",strlen(\"--dump-only\"))|| - !strncmp(argv[i],\"--dump\", strlen(\"--dump\"))) { + } else if (!strcmp(argv[i], \"--verbose\")) { + verbosity++; + } else if (!strcmp(argv[i], \"--dump-only\")|| + !strcmp(argv[i], \"--dump\")) { xbt_test_dump(selection); return 0; - } else if (!strncmp(argv[i],\"--help\",strlen(\"--help\"))) { + } else if (!strcmp(argv[i], \"--help\")) { printf( "Usage: testall [--help] [--tests=selection] [--dump-only]\\n\\n" "--help: display this help\\n" + "--verbose: print the name for each running test\\n" "--dump-only: don't run the tests, but display some debuging info about the tests\\n" "--tests=selection: Use argument to select which suites/units/tests to run\\n" " --tests can be used more than once, and selection may be a comma\\n" @@ -187,7 +185,7 @@ int main(int argc, char *argv[]) { } /* Got all my tests to do */ - res = xbt_test_run(selection); + res = xbt_test_run(selection, verbosity); xbt_test_exit(); return res; } @@ -247,7 +245,7 @@ EOF last if /SGU: BEGIN SUITES DECLARATION/; } - ### Done with prototypes. And now, the actual code + ### Done with prototypes. And now, the actual code # search my prototype while () {