A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
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
diff --git
a/buildtools/Cmake/Scripts/tesh.pl
b/buildtools/Cmake/Scripts/tesh.pl
index
31acb42
..
07e609e
100755
(executable)
--- a/
buildtools/Cmake/Scripts/tesh.pl
+++ b/
buildtools/Cmake/Scripts/tesh.pl
@@
-38,6
+38,7
@@
if($^O eq "linux"){
}
else{
$OS = "WIN";
}
else{
$OS = "WIN";
+ $ENV{"PRINTF_EXPONENT_DIGITS"} = "2";
}
}
@@
-243,7
+244,7
@@
sub exec_cmd {
###
# exec the command line
###
# exec the command line
- ###
+ ###
$line =~ s/\r//g;
$pid = open3(\*CHILD_IN, \*OUT, \*OUT, $cmd{'cmd'} );
# push all provided input to executing child
$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;
die "fork() failed: $!" unless defined $forked;
if ( $forked == 0 ) { # child
sleep $time_to_wait;
- kill(
9
, $pid);
+ kill(
SIGKILL
, $pid);
exit $time_to_wait;
}
}
exit $time_to_wait;
}
}
@@
-392,6
+393,7
@@
LINE: while (not $finished and not $error) {
$line_num++;
chomp $line;
$line_num++;
chomp $line;
+ $line =~ s/\r//g;
print "[TESH/debug] $line_num: $line\n" if $opts{'debug'};
my $next;
# deal with line continuations
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;
}
}
$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 = ();
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";
}
} 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){
if($forked){
- kill(
9
, $forked);
+ kill(
SIGKILL
, $forked);
$timeout=0;
}
$timeout=0;
}