From ca42459cd7c72b69c8cf67e6b5152157b302ef37 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 18 Oct 2020 14:21:25 -0700 Subject: [PATCH] scripts/run_tests.sh: be compatible with old bash versions Prior to bash 4.4, using an empty array with 'set -u' produced an error. Work around it. --- scripts/run_tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 5af6bb9..34fe0fc 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -142,20 +142,20 @@ native_build_and_test() { # we test disabling. We just disable the features roughly in order from # newest to oldest for each architecture, cumulatively. In practice, # that's good enough to cover all the code. - local features=() + local features=('') if ! [[ "$*" =~ "-march=native" ]]; then case "$(uname -m)" in i386|x86_64) - features=(avx512bw avx2 avx bmi2 pclmul sse2) + features+=(avx512bw avx2 avx bmi2 pclmul sse2) ;; arm*|aarch*) - features=(crc32 pmull neon) + features+=(crc32 pmull neon) ;; esac fi local disable_str="" local feature - for feature in "" "${features[@]}"; do + for feature in "${features[@]}"; do if [ -n "$feature" ]; then if [ -n "$disable_str" ]; then disable_str+=","