2015-05-05 19:58:25 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
cd "${BASEDIR}"
|
|
|
|
. "./driver-lib.bash"
|
|
|
|
|
|
|
|
start="$(date +%s)"
|
|
|
|
|
|
|
|
check_prereqs || die "prerequisites unsatsfied."
|
|
|
|
|
2015-10-22 21:46:28 -04:00
|
|
|
# command line options
|
|
|
|
while [[ $# > 1 ]]
|
|
|
|
do
|
|
|
|
key="${1}"
|
|
|
|
case $key in
|
|
|
|
-v|--version)
|
|
|
|
VERSION="${2}"
|
|
|
|
shift && shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# unknown option
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2018-03-27 18:16:55 -04:00
|
|
|
VERSION="${VERSION:-3.6.4}"
|
2015-10-22 21:46:28 -04:00
|
|
|
|
2015-05-05 19:58:25 -04:00
|
|
|
declare -a tests=()
|
|
|
|
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
while read file; do
|
|
|
|
tests+=("${file}")
|
|
|
|
done < <(find tests -type f -name '*.bash')
|
|
|
|
else
|
|
|
|
tests=("$@")
|
|
|
|
fi
|
|
|
|
|
2015-10-22 21:46:28 -04:00
|
|
|
initialize "${#tests[@]}" "${VERSION}"
|
2015-05-05 19:58:25 -04:00
|
|
|
|
|
|
|
for file in "${tests[@]}"; do
|
2015-10-22 21:46:28 -04:00
|
|
|
run_test "$(basename "${file}")" "${VERSION}"
|
2015-05-05 19:58:25 -04:00
|
|
|
done
|
|
|
|
|
|
|
|
if report; then
|
|
|
|
ret=0
|
|
|
|
else
|
|
|
|
ret=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "(tests run in $(($(date +%s) - start)) seconds)"
|
|
|
|
exit ${ret}
|