summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2016-02-03 10:05:51 +0100
committerPavel Raiskup <praiskup@redhat.com>2016-02-03 10:12:33 +0100
commit498566799618cba7d0e7b22140673f0582814054 (patch)
treee9af7244673233b67a5726e7640f715426921052
parenta5c6466528c060cc4660ad0319c00740db0e42ba (diff)
downloadlibtool-498566799618cba7d0e7b22140673f0582814054.tar.gz
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.
-rw-r--r--NO-THANKS1
-rwxr-xr-xgl/tests/test-option-parser-helper9
-rwxr-xr-xgl/tests/test-option-parser.sh2
3 files changed, 8 insertions, 4 deletions
diff --git a/NO-THANKS b/NO-THANKS
index 51ec8eb0..8631c316 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 d92747a2..52ba6689 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 816dd03c..43bef64d 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 ()
{