]> Savannah Git Hosting - gnulib.git/commitdiff
tests: restrict shells to those that support 'local'
authorPádraig Brady <P@draigBrady.com>
Fri, 3 Jul 2015 13:52:47 +0000 (14:52 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 3 Jul 2015 14:29:30 +0000 (15:29 +0100)
The local keyword is very widely supported and used
in tests in coreutils and grep at least.  Therefore
restrict to testing with shells that support it.
This mainly excludes /bin/sh on Solaris.
Note standard ksh also doesn't support this keyword,
but that wasn't in the list of considered shells anyway.
For discussion on adding 'local' to POSIX, see:
http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/122267/focus=3271

* tests/init.sh (gl_shell_test_script_): Add a test for 'local'.

ChangeLog
tests/init.sh

index c3b45f4f91893f9f1b31e1883bd9743917e19ce2..03ffdac0ef80324f13a111779ea7b766f92d6196 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-07-03  Pádraig Brady  <P@draigBrady.com>
+
+       tests: restrict shells to those that support 'local'
+       The local keyword is very widely supported and used
+       in tests in coreutils and grep at least.  Therefore
+       restrict to testing with shells that support it.
+       This mainly excludes /bin/sh on Solaris.
+       * tests/init.sh (gl_shell_test_script_): Add a test for 'local'.
+
 2015-07-03  Seiya Kawashima <skawashima@uchicago.edu>  (tiny change)
        and Daiki Ueno  <ueno@gnu.org>
 
index 9f403c51d2ed9cd0f85f492df721df97c573d65b..d36620610e3cd4e772ec87ac26b21e388c815802 100644 (file)
@@ -150,6 +150,7 @@ fi
 #  ? - not ok
 gl_shell_test_script_='
 test $(echo y) = y || exit 1
+f_local_() { local v=1; }; f_local_ || exit 1
 score_=10
 if test "$VERBOSE" = yes; then
   test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9