automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 29/32] tests: "am_using_tap=yes" -> "am_test_protocol=tap"


From: Stefano Lattarini
Subject: [PATCH 29/32] tests: "am_using_tap=yes" -> "am_test_protocol=tap"
Date: Thu, 26 Jul 2012 14:04:55 +0200

And similarly, "am_using_tap=no" -> "am_test_protocol=none".

The new '$am_test_protocol' name is clearer, and will allow the easy
addition of further test protocols in the future.  This is not truly
relevant for automake, but we are trying to make some parts of our
testsuite framework as general as possible, in view of a future move
to a more generic project like Gnulib.

* Makefile.am, t/ax/am-test-lib.sh, t/ax/test-defs.in, t/ax/test-lib.sh,
t/self-check-env-sanitize.tap, t/self-check-tap.sh: Adjust.
* syntax-checks.mk (sc_tests_obsolete_variables): Add 'am_using_tap' to
the list of obsolete variables to check against.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 Makefile.am                   |  2 +-
 syntax-checks.mk              |  1 +
 t/ax/am-test-lib.sh           |  4 ++--
 t/ax/test-defs.in             |  9 ++++++---
 t/ax/test-lib.sh              |  4 ++--
 t/self-check-env-sanitize.tap |  2 +-
 t/self-check-tap.sh           | 14 +++++++-------
 7 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d255288..61a0443 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -337,7 +337,7 @@ TESTS = ## Will be updated later.
 AM_TESTS_ENVIRONMENT = \
   for v in \
     required \
-    am_using_tap \
+    am_test_protocol \
     am_serial_tests \
     am_test_prefer_config_shell \
     am_original_AUTOMAKE \
diff --git a/syntax-checks.mk b/syntax-checks.mk
index bcaf50f..3a0d48c 100644
--- a/syntax-checks.mk
+++ b/syntax-checks.mk
@@ -283,6 +283,7 @@ sc_tests_make_without_am_makeflags:
 sc_tests_obsolete_variables:
        @vars=" \
          using_tap \
+         am_using_tap \
          test_prefer_config_shell \
          original_AUTOMAKE \
          original_ACLOCAL \
diff --git a/t/ax/am-test-lib.sh b/t/ax/am-test-lib.sh
index 8a0e117..ee56068 100644
--- a/t/ax/am-test-lib.sh
+++ b/t/ax/am-test-lib.sh
@@ -155,7 +155,7 @@ AUTOMAKE_run ()
   $AUTOMAKE ${1+"$@"} >stdout 2>stderr || am__got_rc=$?
   cat stderr >&2
   cat stdout
-  if test $am_using_tap != yes; then
+  if test $am_test_protocol = none; then
     test $am__got_rc -eq $am__exp_rc || exit 1
     return
   fi
@@ -795,6 +795,6 @@ am_setup_testdir ()
 am_extra_info ()
 {
   echo "Running from installcheck: $am_running_installcheck"
-  echo "Using TAP: $am_using_tap"
+  echo "Test Protocol: $am_test_protocol"
   echo "PATH = $PATH"
 }
diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in
index 7a03f92..d0063cf 100644
--- a/t/ax/test-defs.in
+++ b/t/ax/test-defs.in
@@ -27,7 +27,7 @@
 # treats such variables as if they were unset.
 for var in \
   required \
-  am_using_tap \
+  am_test_protocol \
   am_serial_tests \
   am_create_testdir \
   am_tap_implementation \
@@ -46,8 +46,11 @@ unset var
 # See whether the current test script is expected to use TAP or not.
 # Use a sensible default, while allowing the scripts to override this
 # check.
-if test -z "$am_using_tap"; then
-  case $argv0 in *.tap) am_using_tap=yes;; *) am_using_tap=no;; esac
+if test -z "$am_test_protocol"; then
+  case $argv0 in
+    *.tap) am_test_protocol=tap;;
+        *) am_test_protocol=none;;
+  esac
 fi
 
 am_rel_srcdir='@srcdir@'
diff --git a/t/ax/test-lib.sh b/t/ax/test-lib.sh
index 9a530b1..6048f81 100644
--- a/t/ax/test-lib.sh
+++ b/t/ax/test-lib.sh
@@ -125,7 +125,7 @@ framework_failure_ () { warn_ "$me: set-up failure: $@"; 
exit 99; }
 # For compatibility with TAP functions.
 skip_all_ () { skip_ "$@"; }
 
-if test $am_using_tap = yes; then
+if test $am_test_protocol = tap; then
   . tap-functions.sh
 fi
 
@@ -220,7 +220,7 @@ am_exit_trap ()
   exit_status=$1
   set +e
   cd "$am_top_builddir"
-  if test $am_using_tap = yes; then
+  if test $am_test_protocol = tap; then
     if test "$planned_" = later && test $exit_status -eq 0; then
       plan_ "now"
     fi
diff --git a/t/self-check-env-sanitize.tap b/t/self-check-env-sanitize.tap
index 3e48d89..4896ce2 100755
--- a/t/self-check-env-sanitize.tap
+++ b/t/self-check-env-sanitize.tap
@@ -29,7 +29,7 @@ plan_ 16 # Two times the number of variable names in $vars.
 vars='
   required
   am_serial_tests
-  am_using_tap
+  am_test_protocol
   am_create_testdir
   am_tap_implementation
   am_test_prefer_config_shell
diff --git a/t/self-check-tap.sh b/t/self-check-tap.sh
index 8d84621..47def71 100755
--- a/t/self-check-tap.sh
+++ b/t/self-check-tap.sh
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Sanity check for the automake testsuite.
-# Make sure that '$am_using_tap' gets automatically defined by
+# Make sure that '$am_test_protocol' gets automatically defined by
 # 'test-defs.sh', but can be overridden by the individual tests.
 
 . test-defs.sh
@@ -23,23 +23,23 @@
 set -ex
 
 $AM_TEST_RUNNER_SHELL -c \
-  ". test-defs.sh && test \$am_using_tap = yes" foo.tap
+  ". test-defs.sh && test \$am_test_protocol = tap" foo.tap
 
 for name in foo.test tap tap.test foo-tap; do
   $AM_TEST_RUNNER_SHELL -c \
-    ". test-defs.sh && test \$am_using_tap = no" $name
+    ". test-defs.sh && test \$am_test_protocol = none" $name
 done
 
 $AM_TEST_RUNNER_SHELL -c "
-  am_using_tap=no
+  am_test_protocol=none
   . test-defs.sh
-  test \$am_using_tap = no
+  test \$am_test_protocol = none
 " foo.tap
 
 $AM_TEST_RUNNER_SHELL -c "
-  am_using_tap=yes
+  am_test_protocol=tap
   . test-defs.sh
-  test \$am_using_tap = yes
+  test \$am_test_protocol = tap
 " foo.test
 
 :
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]