From: Stefano Lattarini Date: Wed, 25 Jul 2012 17:41:57 +0000 (+0200) Subject: test init: refactor: new function 'process_requirements' X-Git-Tag: v1.12.3~31^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a915b9a8afcd3b8ae119330cea79ba97cf27fc3;p=thirdparty%2Fautomake.git test init: refactor: new function 'process_requirements' * t/ax/test-init.sh (process_requirements): Here. Use it in to check that the tools in $required are present. Signed-off-by: Stefano Lattarini --- diff --git a/t/ax/test-init.sh b/t/ax/test-init.sh index d6fc8a6b6..d760d6ec7 100644 --- a/t/ax/test-init.sh +++ b/t/ax/test-init.sh @@ -870,17 +870,24 @@ require_tool () esac } -# Look for (and maybe set up) required tools and/or system features; skip -# the current test if they are not found. -for am_tool in $required; do - require_tool $am_tool -done -unset am_tool - -# We might need extra macros, e.g., from Libtool or Gettext. -case " $required " in *\ libtool*) . ./t/libtool-macros.dir/get.sh;; esac -case " $required " in *\ gettext*) . ./t/gettext-macros.dir/get.sh;; esac +process_requirements () +{ + # Look for (and maybe set up) required tools and/or system features; + # skip the current test if they are not found. + for am_tool in $*; do + require_tool $am_tool + done + unset am_tool + # We might need extra macros, e.g., from Libtool or Gettext. + case " $required " in + *\ libtool*) . ./t/libtool-macros.dir/get.sh;; + esac + case " $required " in + *\ gettext*) . ./t/gettext-macros.dir/get.sh;; + esac +} +process_requirements $required ## ---------------------------------------------------------------- ## ## Create and set up of the temporary directory used by the test. ##