[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/32] test init: refactor: new function 'require_tool'
From: |
Stefano Lattarini |
Subject: |
[PATCH 13/32] test init: refactor: new function 'require_tool' |
Date: |
Thu, 26 Jul 2012 14:04:39 +0200 |
* t/ax/test-init.sh (require_tool): Here.
Use it in the loop in the prerequisites in $required.
Signed-off-by: Stefano Lattarini <address@hidden>
---
t/ax/test-init.sh | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/t/ax/test-init.sh b/t/ax/test-init.sh
index 95a42e0..d6fc8a6 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) </dev/null \
- || skip_all_ "required program '$tool' not available"
+ ($1 --version) </dev/null \
+ || skip_all_ "required program '$1' not available"
;;
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
--
1.7.12.rc0
- [PATCH 04/32] perf tests: reorganize, (continued)
- [PATCH 04/32] perf tests: reorganize, Stefano Lattarini, 2012/07/26
- [PATCH 09/32] tests: update PATH early from AM_TESTS_ENVIRONMENT and runtest, Stefano Lattarini, 2012/07/26
- [PATCH 06/32] gen-tests: less hard-coding of 't' as the test directory, Stefano Lattarini, 2012/07/26
- [PATCH 10/32] test defs: move in 't/ax/test-defs.sh', Stefano Lattarini, 2012/07/26
- [PATCH 08/32] runtest: export $srcdir for use by the test scripts, Stefano Lattarini, 2012/07/26
- [PATCH 12/32] test init: remove a couple of paranoid sanity checks, Stefano Lattarini, 2012/07/26
- [PATCH 15/32] test init: refactor: new function 'am_exit_trap', Stefano Lattarini, 2012/07/26
- [PATCH 14/32] test init: refactor: new function 'process_requirements', Stefano Lattarini, 2012/07/26
- [PATCH 18/32] test init: refactor: new function 'am_setup_testdir', Stefano Lattarini, 2012/07/26
- [PATCH 13/32] test init: refactor: new function 'require_tool',
Stefano Lattarini <=
- [PATCH 17/32] test init: refactor: new function 'am_set_exit_traps', Stefano Lattarini, 2012/07/26
- [PATCH 11/32] tests: simplify sourcing of helper shell files, Stefano Lattarini, 2012/07/26
- [PATCH 19/32] test init: refactor: move displaying of debugging info later, Stefano Lattarini, 2012/07/26
- [PATCH 16/32] configure: testsuite shell set exit traps in shell functions, Stefano Lattarini, 2012/07/26
- [PATCH 21/32] test setup: merge definitions of function for simple tests, Stefano Lattarini, 2012/07/26
- [PATCH 23/32] tests: split test libs into "generic" and "automake-specific", Stefano Lattarini, 2012/07/26
- [PATCH 27/32] configure: testsuite shell can return early from "dot-sourced" files, Stefano Lattarini, 2012/07/26
- [PATCH 25/32] tests: source test defs in the generic test lib, Stefano Lattarini, 2012/07/26
- [PATCH 22/32] test setup: move actual calling of testsuite setup in ./defs, Stefano Lattarini, 2012/07/26
- [PATCH 26/32] tests: move sanitization and "Bournification" in the generic test lib, Stefano Lattarini, 2012/07/26