Dmitry V. Levin | 4e4b5ad | 2011-02-27 00:28:50 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | ME_="${0##*/}" |
| 4 | |
| 5 | warn_() { printf >&2 '%s\n' "$*"; } |
| 6 | fail_() { warn_ "$ME_: failed test: $*"; exit 1; } |
| 7 | skip_() { warn_ "$ME_: skipped test: $*"; exit 77; } |
| 8 | framework_failure_() { warn_ "$ME_: framework failure: $*"; exit 99; } |
| 9 | |
| 10 | check_prog() |
| 11 | { |
| 12 | "$@" --version > /dev/null 2>&1 || |
| 13 | framework_failure_ "$* is not available" |
| 14 | } |
| 15 | |
| 16 | check_strace() |
| 17 | { |
| 18 | STRACE=${*-../strace} |
| 19 | $STRACE -V > /dev/null || |
| 20 | framework_failure_ "$STRACE is not available" |
| 21 | } |