1 # Common helper routines for test shell scripts -- intended to be sourced by them
11 echo "$Test $0 SKIP ($WHY)"
15 # portable implementation of 'which' utility
26 if [ -f "$D/$PROG" ] && [ -x "$D/$PROG" ]; then
27 printf '%s\n' "$D/$PROG"
36 if [ -z "$(findprog $1)" ]; then
37 test_skip "missing $1"
41 # Some stuff for doing silly progress indicators
47 RANGE="$(($LAST - $FIRST))"
48 PROG="$(($THIS - $FIRST))"
49 # this automatically rounds to nearest integer
50 PERC="$(((100 * $PROG) / $RANGE))"
51 # note \r so next update will overwrite
52 printf "%3d%%\r" $PERC