cmdlineTests.sh: Add --exclude option

This commit is contained in:
Kamil Śliwak
2023-06-19 16:43:30 +02:00
parent 4752b31e6c
commit 399457d74b
2 changed files with 16 additions and 2 deletions
+12
View File
@@ -43,6 +43,7 @@ pushd "${REPO_ROOT}/test/cmdlineTests" > /dev/null
autoupdate=false
no_smt=false
declare -a included_test_patterns
declare -a excluded_test_patterns
while [[ $# -gt 0 ]]
do
case "$1" in
@@ -54,6 +55,12 @@ do
no_smt=true
shift
;;
--exclude)
[[ $2 != '' ]] || fail "No pattern given to --exclude option or the pattern is empty."
excluded_test_patterns+=("$2")
shift
shift
;;
*)
included_test_patterns+=("$1")
shift
@@ -70,6 +77,11 @@ do
done
test_name_filter+=(')')
for pattern in "${excluded_test_patterns[@]}"
do
test_name_filter+=(-and -not -name "$pattern")
done
# NOTE: We want leading symbols in names to affect the sort order but without
# LC_COLLATE=C sort seems to ignore them.
# shellcheck disable=SC2207 # We do not support test names containing spaces.