]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
gl-tests: dash && option-parser test fix
authorPavel Raiskup <praiskup@redhat.com>
Wed, 3 Feb 2016 09:05:51 +0000 (10:05 +0100)
committerPavel Raiskup <praiskup@redhat.com>
Wed, 3 Feb 2016 09:12:33 +0000 (10:12 +0100)
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.

NO-THANKS
gl/tests/test-option-parser-helper
gl/tests/test-option-parser.sh

index 51ec8eb08d0ffc5b475ad715341a4573607e0a99..8631c31683b93993c89940b0fe481589b3579938 100644 (file)
--- 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
index d92747a21c82b89c3fbebbba723e1c453f5ddd02..52ba6689ac39f9a9d1b4442d443c3bf7b205e28f 100755 (executable)
@@ -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
 
index 816dd03c642cbdc64ea0385228e4fa6cd3dcb272..43bef64ddf89bba11a121bb7c9144737d0af3b94 100755 (executable)
@@ -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 ()
 {