Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[tesh] Fix arguments in tesh file
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 29 Sep 2015 09:26:07 +0000 (11:26 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 29 Sep 2015 09:26:07 +0000 (11:26 +0200)
Example:

    $ tesh with_mutex_handling.tesh --cfg=model-check/reduction:none
    Test suite from stdin

- remove the options from the tesh @ARGV before handling the .tesh
  file;

- GetOptions() can't modify the locally-scoped (my) @ARGV, use the
  global one instead.

tools/tesh/tesh.pl

index 47061ab..3c7c380 100755 (executable)
@@ -137,10 +137,6 @@ if ( $ARGV[0] eq "--internal-killer-process" ) {
 
 sub get_options {
 
-    # remove the tesh file from the ARGV used
-    my @ARGV = @_;
-    $tesh_file = pop @ARGV;
-
     # temporary arrays for GetOption
     my @cfg;
     my $log;    # ignored
@@ -167,6 +163,8 @@ sub get_options {
         'enable-coverage+' => \$enable_coverage,
     );
 
+    $tesh_file = pop @ARGV;
+
     if ($enable_coverage) {
         print "Enable coverage\n";
     }
@@ -192,7 +190,7 @@ sub get_options {
     return %opt;
 }
 
-my %opts = get_options(@ARGV);
+my %opts = get_options();
 
 ##
 ## File parsing