1 # Common helper routines for test shell scripts -- intended to be sourced by them
5 echo "$Test $0 SKIP ($WHY)"
9 # portable implementation of 'which' utility
20 if [ -f "$D/$PROG" ] && [ -x "$D/$PROG" ]; then
21 printf '%s\n' "$D/$PROG"
30 if [ -z "$(findprog $1)" ]; then
31 test_skip "missing $1"
35 # Some stuff for doing silly progress indicators
41 RANGE="$(($LAST - $FIRST))"
42 PROG="$(($THIS - $FIRST))"
43 # this automatically rounds to nearest integer
44 PERC="$(((100 * $PROG) / $RANGE))"
45 # note \r so next update will overwrite
46 printf "%3d%%\r" $PERC