X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6eb1203decdbf9770b36a9b2103d4e5a364edffe..5dc6f3c7fb898d0b145d63384f013410fd042a59:/tools/sg_unit_extractor.pl diff --git a/tools/sg_unit_extractor.pl b/tools/sg_unit_extractor.pl index 031329acaa..1c29e79fab 100755 --- a/tools/sg_unit_extractor.pl +++ b/tools/sg_unit_extractor.pl @@ -1,5 +1,11 @@ #! /usr/bin/perl +# Copyright (c) 2005-2012, 2014. The SimGrid Team. +# All rights reserved. + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the license (GNU LGPL) which comes with this package. + use strict; use strict; @@ -38,6 +44,7 @@ sub process_one($) { $outfile = $infile; $outfile =~ s/\.c$/_unit.c/; + $outfile =~ s/\.cpp$/_unit.cpp/; $outfile =~ s|.*/([^/]*)$|$1| if $outfile =~ m|/|; $outfile = "$outdir$outfile"; @@ -130,8 +137,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 */ @@ -148,6 +157,8 @@ int main(int argc, char *argv[]) { strcat(selection, \",\"); strcat(selection, p); } + } else if (!strcmp(argv[i], \"--verbose\")) { + verbosity++; } else if (!strcmp(argv[i], \"--dump-only\")|| !strcmp(argv[i], \"--dump\")) { xbt_test_dump(selection); @@ -156,6 +167,7 @@ int main(int argc, char *argv[]) { 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" @@ -180,7 +192,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; }