Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more windows compliancy fun
[simgrid.git] / buildtools / Cmake / Scripts / tesh.pl
index c4d9722..0cc491c 100755 (executable)
@@ -258,7 +258,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,9 +392,6 @@ LINE: while (not $finished and not $error) {
 
   $line_num++;
   chomp $line;
-  if($line!=~/\s/){
-    next LINE;
-  }
   print "[TESH/debug] $line_num: $line\n" if $opts{'debug'};
   my $next;
   # deal with line continuations
@@ -409,7 +406,7 @@ LINE: while (not $finished and not $error) {
   }
 
   # Push delayed commands on empty lines
-  unless ($line =~ m/^(.)\s*(.*)$/) {
+  unless ($line =~ m/^(.).(.*)$/) {
     if (defined($cmd{'cmd'})) {
       exec_cmd(\%cmd);
       %cmd = ();
@@ -489,7 +486,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 = ();
@@ -534,6 +531,11 @@ LINE: while (not $finished and not $error) {
   } else {
     die "[TESH/CRITICAL] parse error: $line\n";
   }
+  if($forked){
+   kill(SIGKILL, $forked);
+   $timeout=0;
+  }
+
 }
 
 
@@ -546,7 +548,7 @@ if (defined($cmd{'cmd'})) {
 
 
 if($forked){
-   kill(9, $forked);
+   kill(SIGKILL, $forked);
    $timeout=0;
 }