From 81b96ed6034441960ba54ffe33989ad5b2b8ac69 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 27 Nov 2018 21:37:53 +0100 Subject: [PATCH] Add --except mode: run all components except a list Allow the list to use wildcards, e.g. you can run the sanity checks with all.sh --except "test_*" "build_*" --- tests/scripts/all.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index f56b23bcfb..2799b66893 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -105,6 +105,7 @@ pre_initialize_variables () { CONFIG_BAK="$CONFIG_H.bak" COMPONENTS= + ALL_EXCEPT=0 MEMORY=0 FORCE=0 INTROSPECTION_MODE= @@ -129,6 +130,19 @@ pre_initialize_variables () { fi } +# Test whether $1 is excluded via $COMPONENTS (a space-separated list of +# wildcard patterns). +component_is_excluded() +{ + set -f + for pattern in $COMPONENTS; do + set +f + case ${1#component_} in $pattern) return 0;; esac + done + set +f + return 1 +} + usage() { cat <