From: Alexandre Oliva Date: Sun, 3 Sep 2000 21:37:22 +0000 (+0000) Subject: * tests/quote.test: Move the match test out of case statements, to X-Git-Tag: multi-language-merge-point~158 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db8a3bd5ac91d5cf523a8c00ad21a5d3affbfa9a;p=thirdparty%2Flibtool.git * tests/quote.test: Move the match test out of case statements, to work around bug in /bin/sh of several OSs. --- diff --git a/ChangeLog b/ChangeLog index cb5a6c2cd..0db4cfa72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2000-09-03 Alexandre Oliva + * tests/quote.test: Move the match test out of case statements, to + work around bug in /bin/sh of several OSs. + * tests/defs (CC): Extract from the libtool script. * tests/link.test, tests/link-2.test, tests/quote.test: Use it. diff --git a/tests/quote.test b/tests/quote.test index 47a07e4f0..6866281ff 100755 --- a/tests/quote.test +++ b/tests/quote.test @@ -86,8 +86,12 @@ for mode in compile link install; do # Trivial. $echo "= trying: no quoting" result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}test" $postargs` || status=1 + # We used to have the contents of $match in the case statement, + # without an intermediate variable, but it would fail on at least + # Solaris' and HP-UX's /bin/sh. Ugh! + match="$preargs ${preflag}${flag}test " case "$result" in - *"$preargs ${preflag}${flag}test "*) + *"$match"*) $echo "= passed: $result" ;; *) @@ -100,8 +104,9 @@ for mode in compile link install; do for mchar in \\ \" \` \$; do $echo "= trying: \\$mchar quoting" result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=1 + match="$preargs ${preflag}${flag}\\${mchar}test\\${mchar} " case "$result" in - *"$preargs ${preflag}${flag}\\${mchar}test\\${mchar} "*) + *"$match"*) $echo "= passed: $result" ;; *) @@ -117,8 +122,9 @@ for mode in compile link install; do $echo "= trying: \"$mchar\" quoting" result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=1 + match="$preargs ${preflag}\"${flag}${mchar}test${mchar}\" " case "$result" in - *"$preargs ${preflag}\"${flag}${mchar}test${mchar}\" "*) + *"$match"*) $echo "= passed: $result" ;; *)