Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
oops
[simgrid.git] / tools / tesh / tesh.pl
index 07bd769..1cb8658 100755 (executable)
@@ -370,7 +370,15 @@ sub exec_cmd {
     ###
     # exec the command line
 
-    my @cmdline = quotewords( '\s+', 0, $cmd{'cmd'} );
+    my @cmdline;
+    if(defined $ENV{VALGRIND_COMMAND}) {
+      push @cmdline, $ENV{VALGRIND_COMMAND};
+      push @cmdline, split(" ", $ENV{VALGRIND_OPTIONS});
+      if($cmd{'timeout'} ne 'no'){
+          $cmd{'timeout'}=$cmd{'timeout'}*20
+      }
+    }
+    push @cmdline, quotewords( '\s+', 0, $cmd{'cmd'} );
     my $input = defined($cmd{'in'})? join("\n",@{$cmd{'in'}}) : "";
     my $output = " " x 10240; $output = ""; # Preallocate 10kB, and reset length to 0
     $cmd{'got'} = \$output;
@@ -782,7 +790,7 @@ sub cd_cmd($) {
 # Command setenv. Gets "variable=content", and update the environment accordingly
 sub setenv_cmd($) {
     my $arg = shift;
-    if ( $arg =~ /^(.*)=(.*)$/ ) {
+    if ( $arg =~ /^(.*?)=(.*)$/ ) {
         my ( $var, $ctn ) = ( $1, $2 );
         print "[Tesh/INFO] setenv $var=$ctn\n";
         $environ{$var} = $ctn;