mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 23:47:53 +00:00
testsuite: Passes testsuite. 'timeout' removed as it did not work.
This commit is contained in:
parent
58750eecaa
commit
9e0541c95a
26
src/parallel
26
src/parallel
|
@ -288,17 +288,17 @@ sub spreadstdin {
|
||||||
# If both --recstart and --recend is given then both must match
|
# If both --recstart and --recend is given then both must match
|
||||||
$recstart = $opt::recstart;
|
$recstart = $opt::recstart;
|
||||||
$recend = $opt::recend;
|
$recend = $opt::recend;
|
||||||
$recerror = "parallel: Warning: --recend and --recstart unmatched. Is --blocksize too small?";
|
$recerror = "parallel: Warning: --recend and --recstart unmatched. Increasing --blocksize.";
|
||||||
} elsif(defined($opt::recstart)) {
|
} elsif(defined($opt::recstart)) {
|
||||||
# If --recstart is given it must match start of record
|
# If --recstart is given it must match start of record
|
||||||
$recstart = $opt::recstart;
|
$recstart = $opt::recstart;
|
||||||
$recend = "";
|
$recend = "";
|
||||||
$recerror = "parallel: Warning: --recstart unmatched. Is --blocksize too small?";
|
$recerror = "parallel: Warning: --recstart unmatched. Increasing --blocksize.";
|
||||||
} elsif(defined($opt::recend)) {
|
} elsif(defined($opt::recend)) {
|
||||||
# If --recend is given then it must match end of record
|
# If --recend is given then it must match end of record
|
||||||
$recstart = "";
|
$recstart = "";
|
||||||
$recend = $opt::recend;
|
$recend = $opt::recend;
|
||||||
$recerror = "parallel: Warning: --recend unmatched. Is --blocksize too small?";
|
$recerror = "parallel: Warning: --recend unmatched. Increasing --blocksize.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($opt::regexp) {
|
if($opt::regexp) {
|
||||||
|
@ -316,20 +316,7 @@ sub spreadstdin {
|
||||||
for my $in (@fhlist) {
|
for my $in (@fhlist) {
|
||||||
piperead: while(1) {
|
piperead: while(1) {
|
||||||
eof($in) and $force_one_time_through++ and last piperead;
|
eof($in) and $force_one_time_through++ and last piperead;
|
||||||
# if(0 and $Global::max_lines and $Global::max_number_of_args) {
|
read($in,substr($buf,length $buf,0),$opt::blocksize);
|
||||||
# # Read $Global::max_number_of_args records of $Global::max_lines lines
|
|
||||||
# my @lines;
|
|
||||||
# my $read_n_lines = ($Global::max_number_of_args || 1) * $Global::max_lines;
|
|
||||||
# for(my $t = 0; !eof($in) and $t < $read_n_lines; $t++) {
|
|
||||||
# my $l = <$in>;
|
|
||||||
# push @lines, $l;
|
|
||||||
# }
|
|
||||||
# substr($buf,length $buf,0) = join("",@lines);
|
|
||||||
# } else {
|
|
||||||
# Read a block
|
|
||||||
read($in,substr($buf,length $buf,0),$opt::blocksize);
|
|
||||||
# substr above = append to $buf
|
|
||||||
# }
|
|
||||||
|
|
||||||
if($opt::r) {
|
if($opt::r) {
|
||||||
# Remove empty lines
|
# Remove empty lines
|
||||||
|
@ -346,7 +333,7 @@ sub spreadstdin {
|
||||||
$n_lines--;
|
$n_lines--;
|
||||||
$last_newline_pos = rindex($buf,"\n",$last_newline_pos-1);
|
$last_newline_pos = rindex($buf,"\n",$last_newline_pos-1);
|
||||||
}
|
}
|
||||||
# Chop at $last_newline_pos
|
# Chop at $last_newline_pos as that is where n-line record ends
|
||||||
write_record_to_pipe(\$header,\$buf,$recstart,$recend,$last_newline_pos+1);
|
write_record_to_pipe(\$header,\$buf,$recstart,$recend,$last_newline_pos+1);
|
||||||
substr($buf,0,$last_newline_pos+1) = "";
|
substr($buf,0,$last_newline_pos+1) = "";
|
||||||
} elsif($opt::regexp) {
|
} elsif($opt::regexp) {
|
||||||
|
@ -383,6 +370,9 @@ sub spreadstdin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# If stuff not written:
|
||||||
|
# Warn $recerror if not already done
|
||||||
|
# blocksize *= 1.1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,13 +11,13 @@ if [ "$TRIES" = "3" ] ; then
|
||||||
# Try a failing test thrice
|
# Try a failing test thrice
|
||||||
echo Retrying 3 times
|
echo Retrying 3 times
|
||||||
ls -t tests-to-run/*${1}*.sh |
|
ls -t tests-to-run/*${1}*.sh |
|
||||||
perl -pe 's:(.*/(.*)).sh:timeout '$TIMEOUT' bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 >/dev/null || timeout '$TIMEOUT' bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 >/dev/null || timeout '$TIMEOUT' bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 || touch $1.sh: ' \
|
perl -pe 's:(.*/(.*)).sh:bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 >/dev/null || bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 >/dev/null || bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 || touch $1.sh: ' \
|
||||||
>$SHFILE
|
>$SHFILE
|
||||||
else
|
else
|
||||||
# Run a failing test once
|
# Run a failing test once
|
||||||
echo Not retrying
|
echo Not retrying
|
||||||
ls -t tests-to-run/*${1}*.sh |
|
ls -t tests-to-run/*${1}*.sh |
|
||||||
perl -pe 's:(.*/(.*)).sh:timeout '$TIMEOUT' bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 || touch $1.sh:' \
|
perl -pe 's:(.*/(.*)).sh:bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 || touch $1.sh:' \
|
||||||
>$SHFILE
|
>$SHFILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
### Test -k
|
### Test -k
|
||||||
parallel: Warning: Only enough filehandles to run 19 jobs in parallel. Raising ulimit -n may help.
|
parallel: Warning: Only enough filehandles to run 20 jobs in parallel. Raising ulimit -n may help.
|
||||||
begin
|
begin
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
|
|
Loading…
Reference in a new issue