return 1
fi
- if (( !explicit && QUICK_RUN && !QUICK && !TIMED )); then
- return
+ if (( ! explicit )); then
+ if (( QUICK_RUN && !QUICK && !TIMED )); then
+ return
+ fi
+ if [[ -n ${EXCLUDE["$test_name"]} ]]; then
+ return
+ fi
fi
printf '%s\0' "$test_name"
_found_group() {
local group="$1"
+ local explicit="$2"
local test_path
+
+ if (( ! explicit )); then
+ if [[ -n ${EXCLUDE["$group"]} ]]; then
+ return
+ fi
+ fi
+
while IFS= read -r -d '' test_path; do
_found_test "${test_path#tests/}" 0
done < <(find "tests/$group" -type f -name '[0-9][0-9][0-9]' -print0)
local group_path
while IFS= read -r -d '' group_path; do
if [[ $group_path != tests/meta ]]; then
- _found_group "${group_path#tests/}"
+ _found_group "${group_path#tests/}" 0
fi
done < <(find tests -mindepth 2 -type f -name group -printf '%h\0')
else
filter="${filter#tests/}"
if [[ -d tests/$filter ]]; then
- _found_group "$filter"
+ _found_group "$filter" 1
elif [[ -f tests/$filter ]]; then
_found_test "$filter" 1
else
runtime of longer tests to the given timeout,
defaulting to 30 seconds)
+ -x, --exclude=TEST exclude a test (or test group) from the list of
+ tests to run
+
Miscellaneous:
-h, --help display this help message and exit"
esac
}
-TEMP=$(getopt -o 'q::h' --long 'quick::,help' -n "$0" -- "$@")
+TEMP=$(getopt -o 'q::x:h' --long 'quick::,exclude:,help' -n "$0" -- "$@")
if [[ $? -ne 0 ]]; then
exit 1
fi
unset TEMP
QUICK_RUN=0
+EXCLUDE=()
while true; do
case "$1" in
'-q'|'--quick')
TIMEOUT="${2:-30}"
shift 2
;;
+ '-x'|'--exclude')
+ EXCLUDE+=("$2")
+ shift 2
+ ;;
'-h'|'--help')
usage out
;;
TEST_DEVS=()
fi
+# Convert the exclude list to an associative array.
+TEMP_EXCLUDE=("${EXCLUDE[@]}")
+unset EXCLUDE
+declare -A EXCLUDE
+for filter in "${TEMP_EXCLUDE[@]}"; do
+ EXCLUDE["$filter"]=1
+done
+unset TEMP_EXCLUDE
+
_check "$@"