Add pup() and use() function to allow skipping when pup is unavailable
The "use pup" construct will skip a test case that needs pup installed. The pup() function ensures that the downloaded binary is used.pull/93/head
parent
60f09e450d
commit
604b43b336
16
t/preamble
16
t/preamble
|
@ -39,6 +39,22 @@ readonly NGINX_PID="${PREFIX}/logs/nginx.pid"
|
|||
rm -f "${NGINX_CONF}" "${NGINX_PID}"
|
||||
mkdir -p "${PREFIX}/logs"
|
||||
|
||||
function pup () {
|
||||
if [[ -x ${TESTDIR}/pup ]] ; then
|
||||
"${TESTDIR}/pup" "$@"
|
||||
else
|
||||
skip 'Test uses "pup", which is not available'
|
||||
fi
|
||||
}
|
||||
|
||||
function use () {
|
||||
case $1 in
|
||||
pup ) [[ -x ${TESTDIR}/pup ]] \
|
||||
|| skip 'Test uses "pup", which is unavailable\n' ;;
|
||||
* ) warn "Invalid 'use' flag: '%s'\n'" "$1" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
function nginx () {
|
||||
env - PATH="${PATH}" "${PREFIX}/sbin/nginx" "$@"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue