Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
chomp may not be enough in some cases + tell win that we want 2 digits only for exponents
[simgrid.git] / buildtools / Cmake / Scripts / tesh.pl
index d74a6d5..07e609e 100755 (executable)
@@ -38,6 +38,7 @@ if($^O eq "linux"){
 }
 else{
     $OS = "WIN";
+    $ENV{"PRINTF_EXPONENT_DIGITS"} = "2"; 
 }
 
 
@@ -243,7 +244,7 @@ sub exec_cmd {
 
   ###
   # exec the command line
-  ###
+  ###  $line =~ s/\r//g;
   $pid = open3(\*CHILD_IN, \*OUT, \*OUT, $cmd{'cmd'} );
 
   # push all provided input to executing child
@@ -258,7 +259,7 @@ sub exec_cmd {
     die "fork() failed: $!" unless defined $forked;
     if ( $forked == 0 ) { # child
       sleep $time_to_wait;
-      kill(9, $pid);
+      kill(SIGKILL, $pid);
       exit $time_to_wait;
     }
   }
@@ -392,6 +393,7 @@ LINE: while (not $finished and not $error) {
 
   $line_num++;
   chomp $line;
+  $line =~ s/\r//g;
   print "[TESH/debug] $line_num: $line\n" if $opts{'debug'};
   my $next;
   # deal with line continuations
@@ -486,7 +488,7 @@ LINE: while (not $finished and not $error) {
     }
     $cmd{'output ignore'} = 1;
   }
-  elsif($line =~ /^!\s*expect signal (\w*)$/) {#expect signal SIGABRT
+  elsif($line =~ /^!\s*expect signal (\w*)/) {#expect signal SIGABRT
     if (defined($cmd{'cmd'})) {
       exec_cmd(\%cmd);
       %cmd = ();
@@ -532,7 +534,7 @@ LINE: while (not $finished and not $error) {
     die "[TESH/CRITICAL] parse error: $line\n";
   }
   if($forked){
-   kill(9, $forked);
+   kill(SIGKILL, $forked);
    $timeout=0;
   }
 
@@ -548,7 +550,7 @@ if (defined($cmd{'cmd'})) {
 
 
 if($forked){
-   kill(9, $forked);
+   kill(SIGKILL, $forked);
    $timeout=0;
 }