]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
test init: refactor: new function 'process_requirements'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 25 Jul 2012 17:41:57 +0000 (19:41 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 26 Jul 2012 12:11:35 +0000 (14:11 +0200)
* 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 <stefano.lattarini@gmail.com>
t/ax/test-init.sh

index d6fc8a6b660a69080122a5f0af94bdfcbb658b36..d760d6ec78c87ede0c80fa8e4f5edd1708d8a797 100644 (file)
@@ -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.  ##