From ca8039e61279fcb1d15ae5333ef9007db85fd870 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 30 Oct 2018 19:04:31 +0100 Subject: [PATCH] tests: don't expect the shell to support 'local' It doesn't work on Solaris 11.3 x86/64. Reported by Kiyoshi Kanazawa. http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00051.html * examples/test: Don't use 'local'. --- examples/test | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/test b/examples/test index 251307b0..96db4e7f 100755 --- a/examples/test +++ b/examples/test @@ -45,7 +45,7 @@ fi # ------- cleanup () { - local status=$? + status=$? if test -z "$DEBUG"; then cd $cwd rm -rf $$.dir @@ -61,22 +61,22 @@ cd $$.dir # -noerr: ignore stderr, otherwise merge it into effective output. run () { - local noerr=false + noerr=false case $1 in (-noerr) noerr=true; shift;; esac # Expected exit status. - local sta_exp="$1" + sta_exp=$1 shift # Expected output. - local out_exp="$1" + out_exp=$1 shift # Effective exit status. - local sta_eff=0 + sta_eff=0 $prog "$@" - out_eff 2>err_eff || sta_eff=$? # Combine effective output and error streams. - local out_eff="$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff)" + out_eff=$(cat out_eff && $noerr || sed -e 's/^/err: /g' err_eff) if test $sta_eff -eq $sta_exp; then if test "$out_eff" = "$out_exp"; then echo "$me: PASS: $number"