automake-patches
[Top][All Lists]
Advanced

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

[PATCH 3/4] {testsuite-work} tests: use both perl and awk implementation


From: Stefano Lattarini
Subject: [PATCH 3/4] {testsuite-work} tests: use both perl and awk implementations for tests on TAP
Date: Mon, 29 Aug 2011 17:26:02 +0200

* tests/gen-wrap-tests (get_list_for_pltap): New function, gets
the list of tests that check the Automake TAP support.
($defines_for_pltap): New variable.
($wrapper_type_list): Add "pltap".
* tests/defs-static.in: Check that `$am_tap_implementation' is
not exported in the environment.
* tests/self-check-env-sanitize.tap: Update.
---
 ChangeLog                         |   11 +++
 tests/Makefile.in                 |  180 +++++++++++++++++++++++++++++++++++-
 tests/defs-static.in              |    1 +
 tests/gen-wrap-tests              |   18 ++++
 tests/self-check-env-sanitize.tap |    3 +-
 5 files changed, 207 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0b11bbb..be5d736 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2011-08-29  Stefano Lattarini  <address@hidden>
 
+       tests: use both perl and awk implementations for tests on TAP
+       * tests/gen-wrap-tests (get_list_for_pltap): New function, gets
+       the list of tests that check the Automake TAP support.
+       ($defines_for_pltap): New variable.
+       ($wrapper_type_list): Add "pltap".
+       * tests/defs-static.in: Check that `$am_tap_implementation' is
+       not exported in the environment.
+       * tests/self-check-env-sanitize.tap: Update.
+
+2011-08-29  Stefano Lattarini  <address@hidden>
+
        tests: two single auxiliary scripts to run/generate wrapped tests
        * tests/config-shell-tests.sh, tests/parallel-tests.sh,
        tests/gen-config-shell-tests, tests/gen-parallel-tests: Deleted,
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 9e28466..e3da364 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -188,10 +188,14 @@ am__test_logs4 = $(am__test_logs3:.ptest.log=.log)
 PTEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/lib/test-driver
 PTEST_LOG_COMPILE = $(PTEST_LOG_COMPILER) $(AM_PTEST_LOG_FLAGS) \
        $(PTEST_LOG_FLAGS)
-TEST_LOGS = $(am__test_logs4:.shtst.log=.log)
+am__test_logs5 = $(am__test_logs4:.shtst.log=.log)
 SHTST_LOG_DRIVER = $(SHELL) $(top_srcdir)/lib/test-driver
 SHTST_LOG_COMPILE = $(SHTST_LOG_COMPILER) $(AM_SHTST_LOG_FLAGS) \
        $(SHTST_LOG_FLAGS)
+TEST_LOGS = $(am__test_logs5:.pltap.log=.log)
+PLTAP_LOG_DRIVER = $(SHELL) $(top_srcdir)/lib/test-driver
+PLTAP_LOG_COMPILE = $(PLTAP_LOG_COMPILER) $(AM_PLTAP_LOG_FLAGS) \
+       $(PLTAP_LOG_FLAGS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -294,7 +298,7 @@ top_srcdir = @top_srcdir@
 
 # Run the tests with the shell detected at configure time.
 LOG_COMPILER = $(SHELL)
-TEST_EXTENSIONS = .test .tap .ptest .shtst
+TEST_EXTENSIONS = .test .tap .ptest .shtst .pltap
 TEST_LOG_COMPILER = $(LOG_COMPILER)
 TAP_LOG_COMPILER = $(LOG_COMPILER)
 TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/lib/tap-driver.sh
@@ -1466,7 +1470,49 @@ wrap_TESTS = check-concurrency-bug9245-w.ptest \
        compile3-w.shtst compile4-w.shtst compile5-w.shtst \
        compile6-w.shtst instsh2-w.shtst instsh3-w.shtst \
        mdate5-w.shtst mdate6-w.shtst missing-w.shtst missing2-w.shtst \
-       missing3-w.shtst missing5-w.shtst mkinst3-w.shtst
+       missing3-w.shtst missing5-w.shtst mkinst3-w.shtst \
+       tap-ambiguous-directive-w.pltap tap-autonumber-w.pltap \
+       tap-bad-prog-w.pltap tap-bailout-and-logging-w.pltap \
+       tap-bailout-suppress-badexit-w.pltap \
+       tap-bailout-suppress-later-diagnostic-w.pltap \
+       tap-bailout-suppress-later-errors-w.pltap tap-bailout-w.pltap \
+       tap-basic-w.pltap tap-color-w.pltap tap-deps-w.pltap \
+       tap-diagnostic-custom-w.pltap tap-diagnostic-w.pltap \
+       tap-doc-w.pltap tap-driver-stderr-w.pltap \
+       tap-empty-diagnostic-w.pltap tap-empty-w.pltap \
+       tap-escape-directive-2-w.pltap tap-escape-directive-w.pltap \
+       tap-exit-w.pltap tap-fancy-w.pltap tap-fancy2-w.pltap \
+       tap-global-log-w.pltap tap-global-result-w.pltap \
+       tap-html-w.pltap tap-log-w.pltap \
+       tap-merge-stdout-stderr-w.pltap \
+       tap-missing-plan-and-bad-exit-w.pltap tap-more-w.pltap \
+       tap-more2-w.pltap tap-msg0-bailout-w.pltap \
+       tap-msg0-directive-w.pltap tap-msg0-misc-w.pltap \
+       tap-msg0-planskip-w.pltap tap-msg0-result-w.pltap \
+       tap-negative-numbers-w.pltap tap-no-disable-hard-error-w.pltap \
+       tap-no-merge-stdout-stderr-w.pltap \
+       tap-no-spurious-numbers-w.pltap \
+       tap-no-spurious-summary-w.pltap tap-no-spurious-w.pltap \
+       tap-not-ok-skip-w.pltap tap-number-wordboundary-w.pltap \
+       tap-numbers-leading-zero-w.pltap \
+       tap-numeric-description-w.pltap tap-out-of-order-w.pltap \
+       tap-passthrough-exit-w.pltap tap-passthrough-w.pltap \
+       tap-plan-corner-w.pltap tap-plan-errors-w.pltap \
+       tap-plan-leading-zero-w.pltap tap-plan-malformed-w.pltap \
+       tap-plan-middle-w.pltap tap-plan-whitespace-w.pltap \
+       tap-plan-w.pltap tap-planskip-and-logging-w.pltap \
+       tap-planskip-badexit-w.pltap tap-planskip-bailout-w.pltap \
+       tap-planskip-case-insensitive-w.pltap \
+       tap-planskip-late-w.pltap tap-planskip-later-errors-w.pltap \
+       tap-planskip-unplanned-corner-w.pltap \
+       tap-planskip-unplanned-w.pltap tap-planskip-whitespace-w.pltap \
+       tap-planskip-w.pltap tap-realtime-w.pltap \
+       tap-recheck-logs-w.pltap tap-recheck-w.pltap \
+       tap-result-comment-w.pltap tap-signal-w.pltap \
+       tap-test-number-0-w.pltap tap-todo-skip-together-w.pltap \
+       tap-todo-skip-whitespace-w.pltap tap-todo-skip-w.pltap \
+       tap-unplanned-w.pltap tap-whitespace-normalization-w.pltap \
+       tap-with-and-without-number-w.pltap tap-xfail-tests-w.pltap
 wrap_LOGS = check-concurrency-bug9245-w.log \
        check-exported-srcdir-w.log check-fd-redirect-w.log \
        check-subst-prog-w.log check-subst-w.log \
@@ -1479,7 +1525,44 @@ wrap_LOGS = check-concurrency-bug9245-w.log \
        compile2-w.log compile3-w.log compile4-w.log compile5-w.log \
        compile6-w.log instsh2-w.log instsh3-w.log mdate5-w.log \
        mdate6-w.log missing-w.log missing2-w.log missing3-w.log \
-       missing5-w.log mkinst3-w.log
+       missing5-w.log mkinst3-w.log tap-ambiguous-directive-w.log \
+       tap-autonumber-w.log tap-bad-prog-w.log \
+       tap-bailout-and-logging-w.log \
+       tap-bailout-suppress-badexit-w.log \
+       tap-bailout-suppress-later-diagnostic-w.log \
+       tap-bailout-suppress-later-errors-w.log tap-bailout-w.log \
+       tap-basic-w.log tap-color-w.log tap-deps-w.log \
+       tap-diagnostic-custom-w.log tap-diagnostic-w.log tap-doc-w.log \
+       tap-driver-stderr-w.log tap-empty-diagnostic-w.log \
+       tap-empty-w.log tap-escape-directive-2-w.log \
+       tap-escape-directive-w.log tap-exit-w.log tap-fancy-w.log \
+       tap-fancy2-w.log tap-global-log-w.log tap-global-result-w.log \
+       tap-html-w.log tap-log-w.log tap-merge-stdout-stderr-w.log \
+       tap-missing-plan-and-bad-exit-w.log tap-more-w.log \
+       tap-more2-w.log tap-msg0-bailout-w.log \
+       tap-msg0-directive-w.log tap-msg0-misc-w.log \
+       tap-msg0-planskip-w.log tap-msg0-result-w.log \
+       tap-negative-numbers-w.log tap-no-disable-hard-error-w.log \
+       tap-no-merge-stdout-stderr-w.log tap-no-spurious-numbers-w.log \
+       tap-no-spurious-summary-w.log tap-no-spurious-w.log \
+       tap-not-ok-skip-w.log tap-number-wordboundary-w.log \
+       tap-numbers-leading-zero-w.log tap-numeric-description-w.log \
+       tap-out-of-order-w.log tap-passthrough-exit-w.log \
+       tap-passthrough-w.log tap-plan-corner-w.log \
+       tap-plan-errors-w.log tap-plan-leading-zero-w.log \
+       tap-plan-malformed-w.log tap-plan-middle-w.log \
+       tap-plan-whitespace-w.log tap-plan-w.log \
+       tap-planskip-and-logging-w.log tap-planskip-badexit-w.log \
+       tap-planskip-bailout-w.log tap-planskip-case-insensitive-w.log \
+       tap-planskip-late-w.log tap-planskip-later-errors-w.log \
+       tap-planskip-unplanned-corner-w.log \
+       tap-planskip-unplanned-w.log tap-planskip-whitespace-w.log \
+       tap-planskip-w.log tap-realtime-w.log tap-recheck-logs-w.log \
+       tap-recheck-w.log tap-result-comment-w.log tap-signal-w.log \
+       tap-test-number-0-w.log tap-todo-skip-together-w.log \
+       tap-todo-skip-whitespace-w.log tap-todo-skip-w.log \
+       tap-unplanned-w.log tap-whitespace-normalization-w.log \
+       tap-with-and-without-number-w.log tap-xfail-tests-w.log
 PTEST_LOG_COMPILER = \
   $(LOG_COMPILER) $(srcdir)/wrap-tests.sh \
   --type ptest --define parallel_tests "yes"
@@ -1488,6 +1571,10 @@ SHTST_LOG_COMPILER = \
   $(LOG_COMPILER) $(srcdir)/wrap-tests.sh \
   --type shtst --define test_prefer_config_shell "yes"
 
+PLTAP_LOG_COMPILER = \
+  $(LOG_COMPILER) $(srcdir)/wrap-tests.sh \
+  --type pltap --define am_tap_implementation "perl"
+
 checked_test_extensions = .test .tap
 expected_list_of_tests = $(handwritten_TESTS)
 am__tmk = tests-in-makefile-list.tmp
@@ -1496,7 +1583,7 @@ am__tdf = diff-in-tests-lists.tmp
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .html .log .ptest .shtst .tap .test .trs
+.SUFFIXES: .html .log .pltap .ptest .shtst .tap .test .trs
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/list-of-tests.mk 
$(srcdir)/wrap-tests.am $(top_srcdir)/CheckListOfTests.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -1742,6 +1829,11 @@ recheck recheck-html:
        --log-file '$*.log' --trs-file '$*.trs' \
        $(am__common_driver_flags) $(AM_SHTST_LOG_DRIVER_FLAGS) 
$(SHTST_LOG_DRIVER_FLAGS) -- $(SHTST_LOG_COMPILE) "$$tst" \
        $(AM_TESTS_FD_REDIRECT)
+.pltap.log:
+       @p='$<'; $(am__check_pre) $(PLTAP_LOG_DRIVER) --test-name "$$f" \
+       --log-file '$*.log' --trs-file '$*.trs' \
+       $(am__common_driver_flags) $(AM_PLTAP_LOG_DRIVER_FLAGS) 
$(PLTAP_LOG_DRIVER_FLAGS) -- $(PLTAP_LOG_COMPILE) "$$tst" \
+       $(AM_TESTS_FD_REDIRECT)
 
 distdir: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -1938,6 +2030,84 @@ missing2-w.log: missing2.test
 missing3-w.log: missing3.test
 missing5-w.log: missing5.test
 mkinst3-w.log: mkinst3.test
+tap-ambiguous-directive-w.log: tap-ambiguous-directive.test
+tap-autonumber-w.log: tap-autonumber.test
+tap-bad-prog-w.log: tap-bad-prog.tap
+tap-bailout-and-logging-w.log: tap-bailout-and-logging.test
+tap-bailout-suppress-badexit-w.log: tap-bailout-suppress-badexit.test
+tap-bailout-suppress-later-diagnostic-w.log: 
tap-bailout-suppress-later-diagnostic.test
+tap-bailout-suppress-later-errors-w.log: tap-bailout-suppress-later-errors.test
+tap-bailout-w.log: tap-bailout.test
+tap-basic-w.log: tap-basic.test
+tap-color-w.log: tap-color.test
+tap-deps-w.log: tap-deps.test
+tap-diagnostic-custom-w.log: tap-diagnostic-custom.test
+tap-diagnostic-w.log: tap-diagnostic.test
+tap-doc-w.log: tap-doc.test
+tap-driver-stderr-w.log: tap-driver-stderr.test
+tap-empty-diagnostic-w.log: tap-empty-diagnostic.test
+tap-empty-w.log: tap-empty.test
+tap-escape-directive-2-w.log: tap-escape-directive-2.test
+tap-escape-directive-w.log: tap-escape-directive.test
+tap-exit-w.log: tap-exit.test
+tap-fancy-w.log: tap-fancy.test
+tap-fancy2-w.log: tap-fancy2.test
+tap-global-log-w.log: tap-global-log.test
+tap-global-result-w.log: tap-global-result.test
+tap-html-w.log: tap-html.test
+tap-log-w.log: tap-log.test
+tap-merge-stdout-stderr-w.log: tap-merge-stdout-stderr.test
+tap-missing-plan-and-bad-exit-w.log: tap-missing-plan-and-bad-exit.test
+tap-more-w.log: tap-more.test
+tap-more2-w.log: tap-more2.test
+tap-msg0-bailout-w.log: tap-msg0-bailout.test
+tap-msg0-directive-w.log: tap-msg0-directive.test
+tap-msg0-misc-w.log: tap-msg0-misc.test
+tap-msg0-planskip-w.log: tap-msg0-planskip.test
+tap-msg0-result-w.log: tap-msg0-result.test
+tap-negative-numbers-w.log: tap-negative-numbers.test
+tap-no-disable-hard-error-w.log: tap-no-disable-hard-error.test
+tap-no-merge-stdout-stderr-w.log: tap-no-merge-stdout-stderr.test
+tap-no-spurious-numbers-w.log: tap-no-spurious-numbers.test
+tap-no-spurious-summary-w.log: tap-no-spurious-summary.test
+tap-no-spurious-w.log: tap-no-spurious.test
+tap-not-ok-skip-w.log: tap-not-ok-skip.test
+tap-number-wordboundary-w.log: tap-number-wordboundary.test
+tap-numbers-leading-zero-w.log: tap-numbers-leading-zero.test
+tap-numeric-description-w.log: tap-numeric-description.test
+tap-out-of-order-w.log: tap-out-of-order.test
+tap-passthrough-exit-w.log: tap-passthrough-exit.test
+tap-passthrough-w.log: tap-passthrough.test
+tap-plan-corner-w.log: tap-plan-corner.test
+tap-plan-errors-w.log: tap-plan-errors.test
+tap-plan-leading-zero-w.log: tap-plan-leading-zero.test
+tap-plan-malformed-w.log: tap-plan-malformed.test
+tap-plan-middle-w.log: tap-plan-middle.test
+tap-plan-whitespace-w.log: tap-plan-whitespace.test
+tap-plan-w.log: tap-plan.test
+tap-planskip-and-logging-w.log: tap-planskip-and-logging.test
+tap-planskip-badexit-w.log: tap-planskip-badexit.test
+tap-planskip-bailout-w.log: tap-planskip-bailout.test
+tap-planskip-case-insensitive-w.log: tap-planskip-case-insensitive.test
+tap-planskip-late-w.log: tap-planskip-late.test
+tap-planskip-later-errors-w.log: tap-planskip-later-errors.test
+tap-planskip-unplanned-corner-w.log: tap-planskip-unplanned-corner.test
+tap-planskip-unplanned-w.log: tap-planskip-unplanned.test
+tap-planskip-whitespace-w.log: tap-planskip-whitespace.test
+tap-planskip-w.log: tap-planskip.test
+tap-realtime-w.log: tap-realtime.test
+tap-recheck-logs-w.log: tap-recheck-logs.test
+tap-recheck-w.log: tap-recheck.test
+tap-result-comment-w.log: tap-result-comment.test
+tap-signal-w.log: tap-signal.test
+tap-test-number-0-w.log: tap-test-number-0.test
+tap-todo-skip-together-w.log: tap-todo-skip-together.test
+tap-todo-skip-whitespace-w.log: tap-todo-skip-whitespace.test
+tap-todo-skip-w.log: tap-todo-skip.test
+tap-unplanned-w.log: tap-unplanned.test
+tap-whitespace-normalization-w.log: tap-whitespace-normalization.test
+tap-with-and-without-number-w.log: tap-with-and-without-number.test
+tap-xfail-tests-w.log: tap-xfail-tests.test
 
 $(srcdir)/wrap-tests.am: gen-wrap-tests list-of-tests.mk Makefile.am
        $(AM_V_GEN)($(am__cd) $(srcdir) \
diff --git a/tests/defs-static.in b/tests/defs-static.in
index 0f62d32..9f7504e 100644
--- a/tests/defs-static.in
+++ b/tests/defs-static.in
@@ -76,6 +76,7 @@ for var in \
   using_tap \
   parallel_tests \
   am_create_testdir \
+  am_tap_implementation \
   test_prefer_config_shell \
   original_AUTOMAKE \
   original_ACLOCAL \
diff --git a/tests/gen-wrap-tests b/tests/gen-wrap-tests
index 23a1a5f..f59a153 100755
--- a/tests/gen-wrap-tests
+++ b/tests/gen-wrap-tests
@@ -91,6 +91,24 @@ get_list_for_shtst ()
 defines_for_shtst='--define test_prefer_config_shell "yes"'
 add_wrapper_type "shtst"
 
+# Tests on tap support should be run with both the perl and awk
+# implementations of the TAP driver.
+get_list_for_pltap ()
+{
+  {
+    grep -l '[ /]tap-setup\.sh'  $*;
+    grep -l '^fetch_tap_driver$' $*;
+    grep -l '^fetch_tap_driver ' $*;
+    grep -l ' fetch_tap_driver$' $*;
+    grep -l ' fetch_tap_driver ' $*;
+  } | LC_ALL=C sort -u \
+    | while read tst; do
+        grep "am_tap_implementation=" $tst >/dev/null || echo $tst
+      done
+}
+defines_for_pltap='--define am_tap_implementation "perl"'
+add_wrapper_type "pltap"
+
 echo '## Generated by gen-wrapped-tests.  DO NOT EDIT.'
 echo 'wrap_TESTS ='
 echo 'wrap_LOGS ='
diff --git a/tests/self-check-env-sanitize.tap 
b/tests/self-check-env-sanitize.tap
index 09a657c..ad6fb31 100755
--- a/tests/self-check-env-sanitize.tap
+++ b/tests/self-check-env-sanitize.tap
@@ -24,7 +24,7 @@ am_create_testdir=no
 set -x
 exec 5>&1
 
-plan_ 16 # Two times the number of variable names in $vars.
+plan_ 18 # Two times the number of variable names in $vars.
 
 vars='
   me
@@ -32,6 +32,7 @@ vars='
   required
   using_tap
   am_create_testdir
+  am_tap_implementation
   test_prefer_config_shell
   original_AUTOMAKE
   original_ACLOCAL
-- 
1.7.2.3




reply via email to

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