From: Stefano Lattarini Date: Wed, 25 Jul 2012 17:23:29 +0000 (+0200) Subject: test init: refactor: new function 'require_tool' X-Git-Tag: v1.12.3~31^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42bd480ccbe3cf252bbf33e0f7a5e5eacc75a5ce;p=thirdparty%2Fautomake.git test init: refactor: new function 'require_tool' * t/ax/test-init.sh (require_tool): Here. Use it in the loop in the prerequisites in $required. Signed-off-by: Stefano Lattarini --- diff --git a/t/ax/test-init.sh b/t/ax/test-init.sh index 95a42e009..d6fc8a6b6 100644 --- a/t/ax/test-init.sh +++ b/t/ax/test-init.sh @@ -635,15 +635,12 @@ require_compiler_ () ## required by them. ## ## ----------------------------------------------------------- ## -# Look for (and maybe set up) required tools and/or system features; skip -# the current test if they are not found. -for tool in : $required -do - # Check that each required tool is present. - case $tool in - :) ;; +require_tool () +{ + am_tool=$1 + case $1 in cc|c++|fortran|fortran77) - require_compiler_ $tool;; + require_compiler_ $1;; xsi-lib-shell) if test x"$am_test_prefer_config_shell" = x"yes"; then require_xsi "$SHELL" @@ -862,16 +859,23 @@ do ;; *) # Generic case: the tool must support --version. - echo "$me: running $tool --version" - # It is not likely but possible that $tool is a special builtin, - # in which case the shell is allowed to exit after an error. So - # we need the subshell here. Also, some tools, like Sun cscope, + echo "$me: running $1 --version" + # It is not likely but possible that the required tool is a special + # builtin, in which case the shell is allowed to exit after an error. + # So we need the subshell here. Also, some tools, like Sun cscope, # can be interactive without redirection. - ($tool --version)