X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/67c91d5b8652b0e76801e9cfc7d965a360237152..818c1ddfc943e736729794a838d4753a335211b0:/buildtools/Cmake/Scripts/tesh.pl diff --git a/buildtools/Cmake/Scripts/tesh.pl b/buildtools/Cmake/Scripts/tesh.pl index 31acb42b13..07e609ee2f 100755 --- a/buildtools/Cmake/Scripts/tesh.pl +++ b/buildtools/Cmake/Scripts/tesh.pl @@ -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 = (); @@ -531,6 +533,11 @@ LINE: while (not $finished and not $error) { } else { die "[TESH/CRITICAL] parse error: $line\n"; } + if($forked){ + kill(SIGKILL, $forked); + $timeout=0; + } + } @@ -543,7 +550,7 @@ if (defined($cmd{'cmd'})) { if($forked){ - kill(9, $forked); + kill(SIGKILL, $forked); $timeout=0; }