2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
8 # First make sure to remove any ARVADOS_ variables from the calling
9 # environment that could interfere with the tests.
10 unset $(env | cut -d= -f1 | grep \^ARVADOS_)
12 # Reset other variables that could affect our [tests'] behavior by
27 if [[ -z "$WORKSPACE" ]] ; then
28 WORKSPACE=$(readlink -f $(dirname $0)/..)
31 declare -a include_tests
32 declare -A exclude_tests
34 declare -A include_install
35 declare -A exclude_install
39 if [[ $(whoami) = 'arvbox' && -f /usr/local/lib/arvbox/common.sh ]] ; then
40 . /usr/local/lib/arvbox/common.sh
44 failures+=("($(basename $0) interrupted)")
49 echo "WORKSPACE is $WORKSPACE"
56 echo >&2 "$helpmessage"
68 repeat=$((${1}+0)); shift
74 include_tests+="$1"; shift
77 exclude_tests[$1]=1; shift
80 include_install[$1]=1; shift
83 if [[ $1 = all ]] ; then
84 include_install["none"]=1
94 echo >&2 "$0: Unrecognized option: '$arg'. Try: $0 --help"
103 find . -name '*.pyc' -delete
105 if [[ -z "${include_tests[@]}" ]] ; then
106 find_run_tests=$(find . -name .run-tests)
108 for t in $find_run_tests ; do
109 [[ $t =~ ./(.*)/.run-tests ]]
110 include_tests+=(${BASH_REMATCH[1]})
114 for t in "${include_tests[@]}" ; do
115 if [[ -n "${exclude_tests[$t]}" ]] ; then
121 . $WORKSPACE/$t/.run-tests
123 if [[ -n "${TESTDEPS}" ]] ; then
127 for TESTDEP in ${TESTDEPS} ; do
129 if [[ $? != 0 ]] ; then
134 if [[ -n "$installfail" ]] ; then
137 for TESTFN in ${TESTS} ; do