init.sh revision 5dec78d0c2663930cd1bbcecbbcee47f68bc52f3
15dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes#!/bin/sh
25dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes
35dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott HughesME_="${0##*/}"
45dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes
55dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott HughesLOG="$ME_.tmp"
65dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughesrm -f "$LOG"
75dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes
85dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hugheswarn_() { printf >&2 '%s\n' "$*"; }
95dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughesfail_() { warn_ "$ME_: failed test: $*"; exit 1; }
105dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughesskip_() { warn_ "$ME_: skipped test: $*"; exit 77; }
115dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughesframework_failure_() { warn_ "$ME_: framework failure: $*"; exit 99; }
125dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughesframework_skip_() { warn_ "$ME_: framework skip: $*"; exit 77; }
135dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes
145dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughescheck_prog()
155dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes{
165dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes	type "$@" > /dev/null 2>&1 ||
175dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes		framework_skip_ "$* is not available"
185dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes}
195dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes
205dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes: "${STRACE:=../strace}"
215dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes: "${TIMEOUT_DURATION:=60}"
225dec78d0c2663930cd1bbcecbbcee47f68bc52f3Elliott Hughes: "${SLEEP_A_BIT:=sleep 1}"
23