2 TIMEOUTCMD
=`dirname "${BASH_SOURCE[0]}"`/babysitter
3 if ! ${TIMEOUTCMD} -h >/dev
/null
2>&1; then
4 TIMEOUTCMD
=timeout
# fall back to timeout if babysitter doesn't work (e.g. python not installed or wrong version)
7 export MONO_BABYSITTER_LOG_FILE
=babysitter_report.json_lines
11 echo "run-step.sh {--label=LABEL} {--skip|--timeout=TIMEOUT [--fatal]} command to run with arguments"
23 shift # past argument=value
27 shift # past argument=value
38 # unknown option, assume just part of cmdline
42 if [ -n "${SKIP}" ] && [ -z "${LABEL}" ]
47 then echo -e "*** start: ${LABEL}\n*** end(0): ${LABEL}: \e[45mSkipped\e[0m"
50 if [ -z "${LABEL}" ] ||
[ -z "${TIMEOUT}" ]
55 echo "*** start: ${LABEL}"
56 if [ -n "${FATAL}" ]; then
57 ${TIMEOUTCMD} --signal=ABRT --kill-after=60s ${TIMEOUT} "$@" && echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[42mPassed\e[0m" || (echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e
[41mFailed\e
[0m
" && exit 1)
59 ${TIMEOUTCMD} --signal=ABRT --kill-after=60s ${TIMEOUT} "$@" && echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[42mPassed\e[0m" || echo -e "*** end($(echo $(date +%s) - ${STARTTIME} | bc)): ${LABEL}: \e[43mUnstable\e[0m"