This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.
#! /bin/bash
set -e
if[[$# -lt 1||$# -gt 2]];then
echo"Usage: $0 <prefix-path> [1]" 1>&2
exit1
fi
# Obtain the absolute path to the tests directory
pushd"$(dirname "$0")"&> /dev/null
readonlyT=$(pwd)
popd&> /dev/null
export T
# Same for the nginx prefix directory
pushd"$1"&> /dev/null
readonlyprefix=$(pwd)
popd&> /dev/null
dynamic=false
if[[$# -gt 1&&$2 -eq 1]];then
dynamic=true
fi
readonly dynamic
declare -a t_pass=()
declare -a t_fail=()
for t in `ls "$T"/*.test | sort -R`;do
name="t/${t##*/}"
name=${name%.test}
printf"${name} ... "
errfile="${name}.err"
outfile="${name}.out"
shfile="${name}.sh"
cat > "${shfile}"<<-EOF
readonly DYNAMIC=${dynamic}
readonly TESTDIR='$T'
readonly PREFIX='${prefix}'
$(< "$T/preamble")
$(< "$t")
EOF
if bash -e "${shfile}" > "${outfile}" 2> "${errfile}";then