Do not time a program that only waits for the timeout
This commit is contained in:
parent
54da06d111
commit
6c15eef5e5
@ -78,6 +78,10 @@ text () { size -A "$1" 2>/dev/null | awk '$1==".text" {print $2}'; }
|
|||||||
# Best of REPS, in whole microseconds. A program that fails on one run and
|
# Best of REPS, in whole microseconds. A program that fails on one run and
|
||||||
# not another would make this meaningless, so the exit status of the first
|
# not another would make this meaningless, so the exit status of the first
|
||||||
# run is remembered and a run that disagrees with it poisons the row as -1.
|
# run is remembered and a run that disagrees with it poisons the row as -1.
|
||||||
|
# A program that hits the timeout is not timed at all: several of the corpus
|
||||||
|
# programs are agents or daemons that sit waiting for something that is not
|
||||||
|
# there, and five repetitions of a twenty-second wait, twice, is most of an
|
||||||
|
# afternoon spent measuring `timeout`.
|
||||||
best () {
|
best () {
|
||||||
exe=$1; min=; rc0=
|
exe=$1; min=; rc0=
|
||||||
for i in $(seq "$REPS"); do
|
for i in $(seq "$REPS"); do
|
||||||
@ -88,6 +92,7 @@ best () {
|
|||||||
[ -n "$rc0" ] || rc0=$rc
|
[ -n "$rc0" ] || rc0=$rc
|
||||||
[ "$rc" = "$rc0" ] || { echo "-1"; return; }
|
[ "$rc" = "$rc0" ] || { echo "-1"; return; }
|
||||||
d=$(( (t1 - t0) / 1000 ))
|
d=$(( (t1 - t0) / 1000 ))
|
||||||
|
[ "$d" -lt 15000000 ] || { echo "-1"; return; }
|
||||||
if [ -z "$min" ] || [ "$d" -lt "$min" ]; then min=$d; fi
|
if [ -z "$min" ] || [ "$d" -lt "$min" ]; then min=$d; fi
|
||||||
done
|
done
|
||||||
echo "$min"
|
echo "$min"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user