From d03962a999263ee24acbf4fe1f87eecdd2b7ba71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Fri, 3 Jul 2015 14:52:47 +0100 Subject: [PATCH] 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. 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 | 9 +++++++++ tests/init.sh | 1 + 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index c3b45f4f91..03ffdac0ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2015-07-03 Pádraig Brady + + 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 (tiny change) and Daiki Ueno diff --git a/tests/init.sh b/tests/init.sh index 9f403c51d2..d36620610e 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -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 -- 2.39.5