From b80f0d20ea063ff0a87ac52e58c8155faf53f8bd Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Sat, 28 Mar 2020 21:37:59 +0100 Subject: [PATCH] Complain if an unsupported component is explicitly requested In all.sh, when an explicit list of components is specified, error out if one of the components is not known or not supported. Patterns that happen to match zero components are still effectively ignored. Fix #2783 Signed-off-by: Gilles Peskine --- tests/scripts/all.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index d95ca7b897..61b17e1022 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -444,6 +444,24 @@ pre_parse_command_line () { COMMAND_LINE_COMPONENTS="$COMMAND_LINE_COMPONENTS *_armcc*" fi + if [ $all_except -eq 0 ]; then + unsupported=0 + for component in $COMMAND_LINE_COMPONENTS; do + case $component in + *[*?\[]*) continue;; + esac + case " $SUPPORTED_COMPONENTS " in + *" $component "*) :;; + *) + echo >&2 "Component $component was explicitly requested, but is not known or not supported." + unsupported=$((unsupported + 1));; + esac + done + if [ $unsupported -ne 0 ]; then + exit 2 + fi + fi + # Build the list of components to run. RUN_COMPONENTS= for component in $SUPPORTED_COMPONENTS; do