From b1107aeee1fcb3afced5dea75171e8ec334c0c5d Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Wed, 4 Oct 2023 12:30:23 +0100 Subject: [PATCH] Tidy up bash syntax Signed-off-by: Dave Rodgman --- tests/scripts/all.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 34089a4029..ace70d1a4f 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -3978,19 +3978,16 @@ build_test_config_combos() { target="t" clang_args="" for ((j = 0; j < ${len}; j++)); do - opt=${options[j]} - X=$(((i >> j) & 1)) - [[ $X == 0 ]] && opt="" || opt="-D${opt}" + opt= + if (((i >> j) & 1)); then + opt=-D${options[j]} + fi clang_args="${clang_args} ${opt}" target="${target}${opt}" done - # check that combination is not known to be invalid - invalid="" - [[ "$validate_options" != "" ]] && invalid=$(${validate_options} "${clang_args}") - - # if valid, add it to the makefile - if [[ "$invalid" == "" ]]; then + # if combination is not known to be invalid, add it to the makefile + if [[ -z $validate_options ]] || [[ $($validate_options "${clang_args}") == "" ]] ; then cmd="${compile_cmd} ${clang_args}" echo "${target}:" >> ${makefile} echo -e "\t$cmd" >> ${makefile}