From: Pavel Raiskup Date: Wed, 3 Feb 2016 09:05:51 +0000 (+0100) Subject: gl-tests: dash && option-parser test fix X-Git-Tag: v2.4.7~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=498566799618cba7d0e7b22140673f0582814054;p=thirdparty%2Flibtool.git gl-tests: dash && option-parser test fix Rico pointed out that the testsuite failed on his system (dash represented /bin/sh). Turns out that 'shift' in dash exits shell with exit status 2 when there are no items in the array. The other issue was that 'test-option-parser.sh' did not re-executed the test in proper shell, but in /bin/sh. * gl/tests/test-option-parser-helper (test_parse_eat_test): Don't shift for empty $@. * gl/tests/test-option-parser.sh: Use $__GL_ALL_SHELLS_SHELL as shell which runs the helper. --- diff --git a/NO-THANKS b/NO-THANKS index 51ec8eb08..8631c3168 100644 --- a/NO-THANKS +++ b/NO-THANKS @@ -125,6 +125,7 @@ Peter Kjellerstedt peter.kjellerstedt@axis.com Pádraig Brady P@draigBrady.com Richard B. Kreckel kreckel@ginac.de Richard Purdie rpurdie@rpsys.net +Rico Tzschichholz ricotz@ubuntu.com Robert Garron Robert.Garron@Access3000.net Robert Ögren lists@roboros.com Robert Yang liezhi.yang@windriver.com diff --git a/gl/tests/test-option-parser-helper b/gl/tests/test-option-parser-helper index d92747a21..52ba6689a 100755 --- a/gl/tests/test-option-parser-helper +++ b/gl/tests/test-option-parser-helper @@ -119,10 +119,13 @@ test_parse_eat_test () _G_opt=$1 ; shift case $_G_opt in --test|-t) - test $# = 0 && func_missing_arg $_G_opt _t_parse_match=: - opt_test=$1 - shift + if test $# = 0; then + func_missing_arg $_G_opt + else + opt_test=$1 + shift + fi ;; esac diff --git a/gl/tests/test-option-parser.sh b/gl/tests/test-option-parser.sh index 816dd03c6..43bef64dd 100755 --- a/gl/tests/test-option-parser.sh +++ b/gl/tests/test-option-parser.sh @@ -23,7 +23,7 @@ all_shells_script=$0 . "$abs_aux_dir"/options-parser || exit 1 -helper=$abs_srcdir/test-option-parser-helper +helper="$__GL_ALL_SHELLS_SHELL $abs_srcdir/test-option-parser-helper" check_output_inner () {