automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, tap-testsuite-work, updated


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, tap-testsuite-work, updated. v1.11-1174-ga956d98
Date: Tue, 09 Aug 2011 21:36:19 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=a956d98634008022ff2541b8b9beebae1e025def

The branch, tap-testsuite-work has been updated
       via  a956d98634008022ff2541b8b9beebae1e025def (commit)
       via  02dfe16d6d4e2738f00e168bc7f5c3a664e02530 (commit)
       via  b3c532b0a3dfb7129bf2119b31e87cc01b49e3d1 (commit)
       via  0bb7fe0d70803fde5fbb818f7c801b2c22d553fd (commit)
       via  1f9b3058c7bb5166dd9f269f7c334797846a67cf (commit)
       via  e61b581a99e7a0af8f8dbb793a707f94b0336395 (commit)
       via  6b5dccd3a8c79a716b25cbda99f555648e898f60 (commit)
       via  1a758e7d0619627aba4f772925154c02e7042f28 (commit)
       via  18fb6351e0d7ffe88aac6043e43bcc5163a1dd53 (commit)
       via  f501499a97946794fe2e5f264e2276ffe826ec07 (commit)
       via  fe1b11ebe22d45eac5625b237d5dd4d20e0d03c8 (commit)
       via  73199a161864ff4f0c692488708c68c22c1c61ea (commit)
       via  6a50baf30f92cdcb393f801e8265eddf17ce00ac (commit)
       via  e171f615247e832582c4806016dc58be7e2f2594 (commit)
      from  b615fcd597e99a8a16cfa873c6848d3c6204f777 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a956d98634008022ff2541b8b9beebae1e025def
Merge: 0bb7fe0 02dfe16
Author: Stefano Lattarini <address@hidden>
Date:   Tue Aug 9 23:27:56 2011 +0200

    Merge branch 'test-protocols' into tap-testsuite-work
    
    * test-protocols:
      test harness: recursive make invocations must use $(AM_MAKEFLAGS)

commit 0bb7fe0d70803fde5fbb818f7c801b2c22d553fd
Merge: e61b581 1f9b305
Author: Stefano Lattarini <address@hidden>
Date:   Tue Aug 9 22:52:06 2011 +0200

    Merge branch 'master' into tap-testsuite-work
    
    * master:
      tests: fix various blunders in 'suffix-chain.test' (edited)

commit e61b581a99e7a0af8f8dbb793a707f94b0336395
Author: Stefano Lattarini <address@hidden>
Date:   Tue Aug 9 22:30:26 2011 +0200

    testsuite: improvements to our shell TAP library and APIs
    
    These improvements impact only the Automake's own testsuite.
    
    * tests/tap-functions.sh (plan_): Allow new special arguments
    "unknown" a.k.a. "later" and "lazy" a.k.a. "now".  Perform
    sanity check the given arguments.  Adjust incorrect comments.
    (lazy_plan_): Removed, superseded by the new version of `plan_'.
    (not): New function, run a command and inverts its exit status.
    (ok_, not_ok_, skip_): These are just shorthands for common
    `result_' usages.
    (xfail_, xpass_, reset_test_count_): Removed, they are not used,
    nor does a legitimate use for them seem in sight.
    (not): New function, to run a command inverting its exit status.
    (command_not_ok_): Removed, superseded by `command_ok_' + `not'.
    (command_ok_): Extended to accept TAP directives.
    * tests/defs (trap): Don't use `late_plan_' anymore, use
    `plan_ "now"' instead.
    * tests/ac-output-old.tap: Update to take advantage of the new
    APIs.
    * tests/self-check-env-sanitize.tap: Likewise.
    * tests/suffix-chain.tap: Likewise.
    * tests/suffix10.tap: Likewise.
    * tests/suffix11.tap: Likewise.
    * tests/suffix3.tap: Likewise.
    * tests/suffix8.tap: Likewise.
    * tests/tap-bad-prog.tap: Likewise.
    * tests/self-check-exit.tap: Likewise, plus a small improvement
    in the name of a variable.

commit 6b5dccd3a8c79a716b25cbda99f555648e898f60
Author: Stefano Lattarini <address@hidden>
Date:   Tue Aug 9 19:14:13 2011 +0200

    testsuite: convert some `suffix*' tests to TAP
    
    This will allow us to explicitly declare some expected failures
    involving Solaris make as such, instead of partly papering over
    them with skips and partly letting them fail too loudly.
    
    * tests/suffix-chain.test: Rename ...
    * tests/suffix-chain.tap: ... to this, and convert to the use of
    TAP.  Also, fix some bugs since we are at it, and ...
    ($required): ... require `cc'.
    * tests/suffix3.test: Rename ...
    * tests/suffix3.tap: ... to this, and convert to the use of TAP.
    Also, since we are at it, throw in some formatting fixes.
    * tests/suffix8.test: Rename ...
    * tests/suffix8.tap: ... to this, and convert to the use of TAP.
    Also, since we are at it, throw in some formatting fixes.
    * tests/suffix10.test: Rename ...
    * tests/suffix10.tap: ... to this, and convert to the use of TAP.
    * tests/suffix11.test: Rename ...
    * tests/suffix11.tap: ... to this, and convert to the use of TAP.
    * tests/Makefile.am (TESTS): Update.

commit 1a758e7d0619627aba4f772925154c02e7042f28
Merge: 73199a1 18fb635
Author: Stefano Lattarini <address@hidden>
Date:   Tue Aug 9 18:13:15 2011 +0200

    Merge branch 'test-protocols' into tap-testsuite-work
    
    * test-protocols:
      tests: don't let a known Solaris make bug poison too many tests
      gitignore: more use of anchors

commit 73199a161864ff4f0c692488708c68c22c1c61ea
Merge: b615fcd 6a50baf
Author: Stefano Lattarini <address@hidden>
Date:   Tue Aug 9 15:38:51 2011 +0200

    Merge branch 'test-protocols' into tap-testsuite-work
    
    (no-op)

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                            |   16 ++--
 ChangeLog                             |   93 ++++++++++++++++++++
 doc/.gitignore                        |   54 ++++++------
 doc/amhello/.gitignore                |   23 +++--
 lib/Automake/.gitignore               |    2 +-
 lib/Automake/tests/.gitignore         |    5 +-
 lib/Automake/tests/Makefile.in        |    2 +-
 lib/am/check.am                       |    2 +-
 tests/Makefile.am                     |    9 +-
 tests/Makefile.in                     |   11 ++-
 tests/ac-output-old.tap               |    2 +-
 tests/defs                            |   38 ++++++++-
 tests/self-check-env-sanitize.tap     |    2 +-
 tests/self-check-exit.tap             |   15 ++--
 tests/suffix-chain.tap                |   64 ++++++++++++++
 tests/{suffix10.test => suffix10.tap} |   16 ++--
 tests/{suffix11.test => suffix11.tap} |   27 ++++--
 tests/{suffix3.test => suffix3.tap}   |   34 +++++---
 tests/{suffix8.test => suffix8.tap}   |   29 ++++---
 tests/tap-bad-prog.tap                |   10 +--
 tests/tap-functions.sh                |  152 ++++++++++++---------------------
 21 files changed, 387 insertions(+), 219 deletions(-)
 create mode 100755 tests/suffix-chain.tap
 rename tests/{suffix10.test => suffix10.tap} (79%)
 rename tests/{suffix11.test => suffix11.tap} (76%)
 rename tests/{suffix3.test => suffix3.tap} (73%)
 rename tests/{suffix8.test => suffix8.tap} (77%)

diff --git a/.gitignore b/.gitignore
index 716ef8b..68a7fde 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,12 +1,12 @@
-autom4te.cache
+/autom4te.cache
+/aclocal
+/automake
+/config.cache
+/config.log
+/config.status
+/config.status.lineno
+/configure.lineno
 Makefile
-aclocal
-automake
-config.cache
-config.log
-config.status
-config.status.lineno
-configure.lineno
 cscope.files
 cscope.in.out
 cscope.out
diff --git a/ChangeLog b/ChangeLog
index 3506838..d91bc59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,98 @@
 2011-08-09  Stefano Lattarini  <address@hidden>
 
+       test harness: recursive make invocations must use $(AM_MAKEFLAGS)
+       * lib/am/check.am ($(TEST_SUITE_LOG)): Pass $(AM_MAKEFLAGS)
+       to $(MAKE) when issuing a recursive make call.
+       Problem detected by the `sc_tests_make_without_am_makeflags'
+       maintainer check.
+
+2011-08-09  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failure in 'suffix-chain.tap'
+       * tests/suffix-chain.test: Use more uncommon suffixes that
+       don't trigger built-in recipes with FreeBSD make.
+
+2011-08-09  Stefano Lattarini  <address@hidden>
+
+       testsuite: improvements to our shell TAP library and APIs
+       These improvements impact only the Automake's own testsuite.
+       * tests/tap-functions.sh (plan_): Allow new special arguments
+       "unknown" a.k.a. "later" and "lazy" a.k.a. "now".  Perform
+       sanity check the given arguments.  Adjust incorrect comments.
+       (lazy_plan_): Removed, superseded by the new version of `plan_'.
+       (not): New function, run a command and inverts its exit status.
+       (ok_, not_ok_, skip_): These are just shorthands for common
+       `result_' usages.
+       (xfail_, xpass_, reset_test_count_): Removed, they are not used,
+       nor does a legitimate use for them seem in sight.
+       (not): New function, to run a command inverting its exit status.
+       (command_not_ok_): Removed, superseded by `command_ok_' + `not'.
+       (command_ok_): Extended to accept TAP directives.
+       * tests/defs (trap): Don't use `late_plan_' anymore, use
+       `plan_ "now"' instead.
+       * tests/ac-output-old.tap: Update to take advantage of the new
+       APIs.
+       * tests/self-check-env-sanitize.tap: Likewise.
+       * tests/suffix-chain.tap: Likewise.
+       * tests/suffix10.tap: Likewise.
+       * tests/suffix11.tap: Likewise.
+       * tests/suffix3.tap: Likewise.
+       * tests/suffix8.tap: Likewise.
+       * tests/tap-bad-prog.tap: Likewise.
+       * tests/self-check-exit.tap: Likewise, plus a small improvement
+       in the name of a variable.
+
+2011-08-09  Stefano Lattarini  <address@hidden>
+
+       testsuite: convert some `suffix*' tests to TAP
+       This will allow us to explicitly declare some expected failures
+       involving Solaris make as such, instead of partly papering over
+       them with skips and partly letting them fail too loudly.
+       * tests/suffix-chain.test: Rename ...
+       * tests/suffix-chain.tap: ... to this, and convert to the use of
+       TAP.  Also, fix some bugs since we are at it, and ...
+       ($required): ... require `cc'.
+       * tests/suffix3.test: Rename ...
+       * tests/suffix3.tap: ... to this, and convert to the use of TAP.
+       Also, since we are at it, throw in some formatting fixes.
+       * tests/suffix8.test: Rename ...
+       * tests/suffix8.tap: ... to this, and convert to the use of TAP.
+       Also, since we are at it, throw in some formatting fixes.
+       * tests/suffix10.test: Rename ...
+       * tests/suffix10.tap: ... to this, and convert to the use of TAP.
+       * tests/suffix11.test: Rename ...
+       * tests/suffix11.tap: ... to this, and convert to the use of TAP.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-08-09  Stefano Lattarini  <address@hidden>
+
+       tests: don't let a known Solaris make bug poison too many tests
+       See automake bug#7670 and bug#7824.
+       * tests/defs (make_can_chain_suffix_rules): New function, tell
+       whether the make implementation in use can chain suffix rules
+       automatically or not.
+       * tests/suffix3.test: Use it to avoid issuing calls to make that
+       are unportable to make implementations that are not smart enough
+       to chain suffix rules automatically.
+       * tests/suffix8.test: Use it to avoid issuing calls to make that
+       * tests/suffix10.test: Use it to avoid issuing calls to make that
+       * tests/suffix11.test: Use it to avoid issuing calls to make that
+       * tests/suffix-chain.test: New test, exposes the limitation that
+       we have papered over in the tests above.
+
+2011-08-09  Stefano Lattarini  <address@hidden>
+
+       gitignore: more use of anchors
+       * .gitignore: Anchor files that are intended to be ignored only
+       if found in the same directory of the `.gitignore' file, not also
+       in its subdirectories.
+       * doc/.gitignore, doc/amhello/.gitignore, lib/Automake/.gitignore,
+       lib/Automake/tests/.gitignore, tests/.gitignore: Likewise.  Also,
+       where needed, add new entries that were once implied by the
+       non-anchored entries in the upper-level `.gitignore' files.
+
+2011-08-09  Stefano Lattarini  <address@hidden>
+
        self tests: avoid spurious output on console, and related fixlets
        * tests/self-check-cleanup.test: Set `$stderr_fileno_' to `2'
        in the self tests, to avoid spurious diagnostic on console.
diff --git a/doc/.gitignore b/doc/.gitignore
index 2554ab9..66b9b42 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -1,27 +1,27 @@
-amhello-*.tar.gz
-automake.info
-automake.info-[0-9]
-automake*.1
-aclocal*.1
-stamp-vti
-version.texi
-automake.ac
-automake.aux
-automake.cm
-automake.cp
-automake.cps
-automake.dvi
-automake.fn
-automake.fns
-automake.html
-automake.ky
-automake.log
-automake.op
-automake.pdf
-automake.pg
-automake.ps
-automake.toc
-automake.tp
-automake.tr
-automake.vr
-automake.vrs
+/amhello-*.tar.gz
+/automake.info
+/automake.info-[0-9]
+/automake*.1
+/aclocal*.1
+/stamp-vti
+/version.texi
+/automake.ac
+/automake.aux
+/automake.cm
+/automake.cp
+/automake.cps
+/automake.dvi
+/automake.fn
+/automake.fns
+/automake.html
+/automake.ky
+/automake.log
+/automake.op
+/automake.pdf
+/automake.pg
+/automake.ps
+/automake.toc
+/automake.tp
+/automake.tr
+/automake.vr
+/automake.vrs
diff --git a/doc/amhello/.gitignore b/doc/amhello/.gitignore
index 466b7a6..cdd9777 100644
--- a/doc/amhello/.gitignore
+++ b/doc/amhello/.gitignore
@@ -1,8 +1,15 @@
-Makefile.in
-aclocal.m4
-config.h.in
-config.h.in~
-configure
-depcomp
-install-sh
-missing
+/Makefile.in
+/Makefile
+/autom4te.cache
+/aclocal.m4
+/config.h.in
+/config.h.in~
+/configure
+/configure.lineno
+/config.status
+/config.status.lineno
+/config.cache
+/config.log
+/depcomp
+/install-sh
+/missing
diff --git a/lib/Automake/.gitignore b/lib/Automake/.gitignore
index d539f93..f99f508 100644
--- a/lib/Automake/.gitignore
+++ b/lib/Automake/.gitignore
@@ -1 +1 @@
-Config.pm
+/Config.pm
diff --git a/lib/Automake/tests/.gitignore b/lib/Automake/tests/.gitignore
index bc2e76d..56e8f36 100644
--- a/lib/Automake/tests/.gitignore
+++ b/lib/Automake/tests/.gitignore
@@ -1,3 +1,2 @@
-*.log
-*.log-t
-*.trs
+/*.trs
+/*.log
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index 582294c..24bc878 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -385,7 +385,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
          redo_bases="$$redo_bases" \
          redo_logs="$$redo_logs" \
          redo_results="$$redo_results" \
-           $(MAKE) am--redo-logs || exit 1; \
+           $(MAKE) $(AM_MAKEFLAGS) am--redo-logs || exit 1; \
        else :; fi;
        @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
        ws='[   ]'; \
diff --git a/lib/am/check.am b/lib/am/check.am
index 2b58c57..76c5273 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -170,7 +170,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
          redo_bases="$$redo_bases" \
          redo_logs="$$redo_logs" \
          redo_results="$$redo_results" \
-           $(MAKE) am--redo-logs || exit 1; \
+           $(MAKE) $(AM_MAKEFLAGS) am--redo-logs || exit 1; \
        else :; fi;
 ## We need a new subshell to work portably with "make -n", since the
 ## previous part of the recipe contained a $(MAKE) invocation.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1a0ef0e..f2e9c2d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1001,19 +1001,20 @@ substre2.test \
 substtarg.test \
 suffix.test \
 suffix2.test \
-suffix3.test \
+suffix3.tap \
 suffix4.test \
 suffix5.test \
 suffix6.test \
 suffix6b.test \
 suffix6c.test \
 suffix7.test \
-suffix8.test \
+suffix8.tap \
 suffix9.test \
-suffix10.test \
-suffix11.test \
+suffix10.tap \
+suffix11.tap \
 suffix12.test \
 suffix13.test \
+suffix-chain.tap \
 symlink.test \
 symlink2.test \
 syntax.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 3a30b84..2821858 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1244,19 +1244,20 @@ substre2.test \
 substtarg.test \
 suffix.test \
 suffix2.test \
-suffix3.test \
+suffix3.tap \
 suffix4.test \
 suffix5.test \
 suffix6.test \
 suffix6b.test \
 suffix6c.test \
 suffix7.test \
-suffix8.test \
+suffix8.tap \
 suffix9.test \
-suffix10.test \
-suffix11.test \
+suffix10.tap \
+suffix11.tap \
 suffix12.test \
 suffix13.test \
+suffix-chain.tap \
 symlink.test \
 symlink2.test \
 syntax.test \
@@ -1531,7 +1532,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
          redo_bases="$$redo_bases" \
          redo_logs="$$redo_logs" \
          redo_results="$$redo_results" \
-           $(MAKE) am--redo-logs || exit 1; \
+           $(MAKE) $(AM_MAKEFLAGS) am--redo-logs || exit 1; \
        else :; fi;
        @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
        ws='[   ]'; \
diff --git a/tests/ac-output-old.tap b/tests/ac-output-old.tap
index ee2d150..5eeb672 100755
--- a/tests/ac-output-old.tap
+++ b/tests/ac-output-old.tap
@@ -48,7 +48,7 @@ acoutbs_check ()
   command_ok_ "can ./configure in $dir" ./configure
   command_ok_ "zot created in $dir" test -f zot
   ls -a > lst || bailout_ "cannot get file listing in $dir"
-  command_not_ok_ "'\\' not leaked in filenames in $dir" grep '\\' lst
+  command_ok_ "'\\' not leaked in filenames in $dir" not grep '\\' lst
   cd ..
 }
 
diff --git a/tests/defs b/tests/defs
index 5e4c2c2..047e22f 100644
--- a/tests/defs
+++ b/tests/defs
@@ -300,6 +300,41 @@ using_gmake ()
 }
 am__using_gmake="" # Avoid interferences from the environment.
 
+# make_can_chain_suffix_rules
+# ---------------------------
+# Return 0 if $MAKE is a make implementation that can chain suffix rules
+# automatically, return 1 otherwise.  Caches the result for speed reasons.
+make_can_chain_suffix_rules ()
+{
+  if test -z "$am__can_chain_suffix_rules"; then
+    if using_gmake; then
+      am__can_chain_suffix_rules=yes
+      return 0
+    else
+      mkdir am__chain.dir$$
+      cd am__chain.dir$$
+      unindent > Makefile << 'END'
+        .u.v: ; cp $< $@
+        .v.w: ; cp $< $@
+END
+      echo make can chain suffix rules > foo.u
+      if $MAKE foo.w && diff foo.u foo.w; then
+        am__can_chain_suffix_rules=yes
+      else
+        am__can_chain_suffix_rules=no
+      fi
+      cd ..
+      rm -rf am__chain.dir$$
+    fi
+  fi
+  case $am__can_chain_suffix_rules in
+    yes) return 0;;
+     no) return 1;;
+      *) fatal_ "make_can_chain_suffix_rules: internal error";;
+  esac
+}
+am__can_chain_suffix_rules="" # Avoid interferences from the environment.
+
 # seq_ - print a sequence of numbers
 # ----------------------------------
 # This function simulates GNU seq(1) portably.  Valid usages:
@@ -349,7 +384,6 @@ rm_rf_ ()
   rm -rf "$@"
 }
 
-
 # count_test_results total=N pass=N fail=N xpass=N xfail=N skip=N error=N
 # -----------------------------------------------------------------------
 # Check that a testsuite run driven by the parallel-tests harness has
@@ -835,7 +869,7 @@ if test "$sh_errexit_works" = yes; then
     fi
     if test $using_tap = yes; then
       if test $have_tap_plan_ != yes; then
-        late_plan_
+        plan_ "now"
       fi
       test $exit_status -eq 0 \
         && test $tap_xfail_count_ -eq 0 \
diff --git a/tests/self-check-env-sanitize.tap 
b/tests/self-check-env-sanitize.tap
index 16e3a99..4556e47 100755
--- a/tests/self-check-env-sanitize.tap
+++ b/tests/self-check-env-sanitize.tap
@@ -49,7 +49,7 @@ do_grep ()
 }
 
 for var in $vars; do
-  command_not_ok_ "$var [err status]" do_run $var
+  command_ok_ "$var [err status]" not do_run $var
   command_ok_ "$var [err message]" do_grep $var
 done
 
diff --git a/tests/self-check-exit.tap b/tests/self-check-exit.tap
index ff0278a..fc3fdca 100755
--- a/tests/self-check-exit.tap
+++ b/tests/self-check-exit.tap
@@ -29,9 +29,9 @@ AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 init='. ./defs; stderr_fileno_=2; unset am_explicit_skips'
 
 for st in 1 2 3 4 5 77 99 126 127 128 129 130 255; do
-  for ex in "Exit $st" "sh -c 'exit $st'"; do
-    rc=0; $SHELL -c  "$init; $ex; :" || rc=$?
-    command_ok_ "$ex" test $rc -eq $st
+  for exit_cmd in "Exit $st" "sh -c 'exit $st'"; do
+    rc=0; $SHELL -c  "$init; $exit_cmd; :" || rc=$?
+    command_ok_ "$exit_cmd" test $rc -eq $st
   done
 done
 
@@ -74,12 +74,9 @@ if $SHELL -c 'set -e; trap "exit \$?" 0; 
non-existent-program'; then
 else
   maybe_todo="" reason=""
 fi
-if $SHELL -c  "$init; non-existent-program; :"; then
-  r='not ok'
-else
-  r='ok'
-fi
-result_ "$r" -D "$maybe_todo" -r "$reason" "command not found"
+rc=0; $SHELL -c  "$init; non-existent-program; :" || rc=$?
+command_ok_ "command not found" -D "$maybe_todo" -r "$reason" \
+            -- test $rc -gt 0
 
 : Non-executable command.
 test -f Makefile && test ! -x Makefile || \
diff --git a/tests/suffix-chain.tap b/tests/suffix-chain.tap
new file mode 100755
index 0000000..680d3f0
--- /dev/null
+++ b/tests/suffix-chain.tap
@@ -0,0 +1,64 @@
+#! /bin/sh
+# Copyright (C) 2002, 2003, 2010, 2011 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that Automake can emit code that work round the inability of
+# some make implementations to automatically chain suffix rules.
+# See automake bug#7824 and bug#7670.
+
+required=cc
+. ./defs || Exit 1
+
+plan_ 8
+
+cat >> configure.in <<'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = foo
+foo_SOURCES = foo.c1
+.c1.c0:
+       (echo 'int main (void)' && echo '{' && cat $<) > $@
+.c0.c:
+       (cat $< && echo '}') > $@
+CLEANFILES = foo.c0 foo.c
+END
+
+echo 'return 0;' > foo.c1
+
+command_ok_ "aclocal"   $ACLOCAL
+command_ok_ "automake"  $AUTOMAKE
+command_ok_ "autoconf"  $AUTOCONF
+command_ok_ "configure" ./configure
+
+directive=''; make_can_chain_suffix_rules || directive=TODO
+
+for target in all distcheck; do
+  command_ok_ "make $target" \
+              -D "$directive" -r "suffix rules not chained" \
+              $MAKE $target
+done
+
+command_ok_ "clean" $MAKE clean
+# Sanity check.
+cat >> Makefile <<'END'
+foo.c: foo.c0
+foo.c0: foo.c1
+END
+command_ok_ "make with explicit dependencies" $MAKE
+
+:
diff --git a/tests/suffix10.test b/tests/suffix10.tap
similarity index 79%
rename from tests/suffix10.test
rename to tests/suffix10.tap
index 9f36c55..d71450d 100755
--- a/tests/suffix10.test
+++ b/tests/suffix10.tap
@@ -54,13 +54,15 @@ cat > foo.x_ << 'END'
 int foo (void) { return yyparse(); }
 END
 
-libtoolize --force
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
+command_ok_ "libtoolize" libtoolize --force
+command_ok_ "aclocal"    $ACLOCAL
+command_ok_ "autoconf"   $AUTOCONF
+command_ok_ "automake"   $AUTOMAKE --add-missing
+command_ok_ "configure"  ./configure
+command_ok_ "make test"  $MAKE test
 
-./configure
-$MAKE test
-$MAKE all
+directive=''; make_can_chain_suffix_rules || directive=TODO
+command_ok_ "make all" -D "$directive" -r "suffix rules not chained" \
+            $MAKE all
 
 :
diff --git a/tests/suffix11.test b/tests/suffix11.tap
similarity index 76%
rename from tests/suffix11.test
rename to tests/suffix11.tap
index 3f0542b..e740f6c 100755
--- a/tests/suffix11.test
+++ b/tests/suffix11.tap
@@ -21,6 +21,8 @@
 required=cc
 . ./defs || Exit 1
 
+plan_ 10
+
 cat >>configure.in <<EOF
 AC_PROG_CC
 AC_OUTPUT
@@ -55,21 +57,26 @@ echo 'INTEGER main(void) { return 0; }' > bar.y-z
 echo 'INTEGER main(void) { INTEGER baz(void); return baz(); }' > baz1.x_
 echo 'INTEGER baz(void) { return 0; }' > baz2.y-z
 
-$ACLOCAL
-$AUTOCONF
+command_ok_ "aclocal" $ACLOCAL
+command_ok_ "autoconf" $AUTOCONF
 
 # What we do is not portable.  Automake should warn.
 AUTOMAKE_fails -a
-grep '[iI]nference rules can have only one target before the colon' stderr
-
+command_ok_ "warn about unportable make usage" \
+  grep '[iI]nference rules can have only one target before the colon' stderr
 # But this should work anyway.
-$AUTOMAKE -a -Wno-portability
+command_ok_ "automake" $AUTOMAKE -a -Wno-portability
+
+command_ok_ "configure"  ./configure
+command_ok_ "make test-fake" env OBJEXT=foo $MAKE -e test-fake
+command_ok_ "make test-real" $MAKE test-real
 
-./configure
+directive=''; make_can_chain_suffix_rules || directive=TODO
 
-OBJEXT=foo $MAKE -e test-fake
-$MAKE test-real
-$MAKE
-$MAKE distcheck
+for target in '' distcheck; do
+  command_ok_ "make $target" \
+              -D "$directive" -r "suffix rules not chained" \
+              $MAKE $target
+done
 
 :
diff --git a/tests/suffix3.test b/tests/suffix3.tap
similarity index 73%
rename from tests/suffix3.test
rename to tests/suffix3.tap
index 70385fe..f1596ce 100755
--- a/tests/suffix3.test
+++ b/tests/suffix3.tap
@@ -20,6 +20,8 @@
 required=c++
 . ./defs || Exit 1
 
+plan_ 10
+
 cat >> configure.in << 'END'
 AC_PROG_CXX
 AC_OUTPUT
@@ -37,40 +39,46 @@ FOO = foo
 CLEANFILES = $(FOO).cc
 END
 
-$ACLOCAL
-$AUTOMAKE
+command_ok_ "aclocal" $ACLOCAL
+command_ok_ "automake" $AUTOMAKE
 
 # The foo.cc intermediate step is implicit, it's a mistake if
 # Automake requires this file somewhere.  Also, Automake should
 # not require the file `foo.c' anywhere.
-$FGREP foo.c Makefile.in && Exit 1
+command_ok_ "intermediate files not mentioned" \
+  not $FGREP foo.c Makefile.in
 # However Automake must figure that foo.zoo is eventually
 # transformed into foo.o, and use this latter file (to link foo).
-$FGREP 'foo.$(OBJEXT)' Makefile.in
+command_ok_ "final object file figured out" \
+  $FGREP 'foo.$(OBJEXT)' Makefile.in
 
-$AUTOCONF
-./configure
+command_ok_ "autoconf" $AUTOCONF
+command_ok_ "configure" ./configure
 
 # This is deliberately valid C++, but invalid C.
 cat > foo.zoo <<'END'
 #include <iostream>
 using namespace std;
-INTEGER main(void)
+INTEGER main (void)
 {
   return 0;
 }
 END
 
-$MAKE
+directive=''; make_can_chain_suffix_rules || directive=TODO
+
+for target in all distcheck; do
+  command_ok_ "make $target"  \
+              -D "$directive" -r "suffix rules not chained" \
+              $MAKE $target
+done
+
 # FIXME: should we check that intermediate file `foo.cc' has
 # been removed?  Or is this requiring too much from the make
 # implementation?
 
 # Intermediate files should not be distributed.
-$MAKE distdir
-test ! -r $me-1.0/foo.cc
-
-# Check the distribution.
-$MAKE distcheck
+command_ok_ "make distdir" $MAKE distdir
+command_ok_ "intermediate file not distributed" test ! -r $me-1.0/foo.cc
 
 :
diff --git a/tests/suffix8.test b/tests/suffix8.tap
similarity index 77%
rename from tests/suffix8.test
rename to tests/suffix8.tap
index 27ac884..7b07496 100755
--- a/tests/suffix8.test
+++ b/tests/suffix8.tap
@@ -21,6 +21,8 @@
 required='cc libtoolize'
 . ./defs || Exit 1
 
+plan_ 10
+
 cat >>configure.in <<'END'
 AM_PROG_LIBTOOL
 AC_OUTPUT
@@ -67,20 +69,23 @@ test2: $(foo_OBJECTS) $(libfoo_la_OBJECTS)
 check-local: test1 test2
 END
 
-echo 'int main(void) { return 0; }' > foo.x_
-echo 'int bar(void) { return 0; }' > bar.x_
+echo 'int main (void) { return 0; }' > foo.x_
+echo 'int bar (void) { return 0; }' > bar.x_
 
-libtoolize
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
+command_ok_ "libtoolize" libtoolize
+command_ok_ "aclocal"    $ACLOCAL
+command_ok_ "autoconf"   $AUTOCONF
+command_ok_ "automake"   $AUTOMAKE -a
+command_ok_ "configure"  ./configure
+command_ok_ "make test0" env OBJEXT=foo $MAKE -e test0
+command_ok_ "make test1" $MAKE test1
 
-./configure
+directive=''; make_can_chain_suffix_rules || directive=TODO
 
-OBJEXT=foo $MAKE -e test0
-$MAKE test1
-$MAKE test2
-$MAKE all
-$MAKE distcheck
+for target in test2 all distcheck; do
+  command_ok_ "make $target"  \
+              -D "$directive" -r "suffix rules not chained" \
+              $MAKE $target
+done
 
 :
diff --git a/tests/tap-bad-prog.tap b/tests/tap-bad-prog.tap
index cf475a1..8ba153f 100755
--- a/tests/tap-bad-prog.tap
+++ b/tests/tap-bad-prog.tap
@@ -77,13 +77,7 @@ fi
 
 # Check that no spurious test results is reported.  This is lower-priority
 # (and in fact the check currently fails.
-if count_test_results total=3 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=3
-then
-  r='ok'
-else
-  r='not ok'
-fi
-result_ "$r" --directive TODO --reason 'still get "missing plan"' \
-            'no spurious results'
+command_ok_ 'no spurious results' -D TODO -r 'still get "missing plan"' \
+  count_test_results total=3 pass=0 fail=0 xpass=0 xfail=0 skip=0 error=3
 
 :
diff --git a/tests/tap-functions.sh b/tests/tap-functions.sh
index 5cd6c1a..603b53c 100644
--- a/tests/tap-functions.sh
+++ b/tests/tap-functions.sh
@@ -42,31 +42,41 @@ else
   incr_ () { eval "$1=\`expr \${$1} + 1\`"; }
 fi
 
-# plan_ NUMBER-OF-PLANNED-TESTS
-# -----------------------------
-# Print a TAP plan for the given number of tests.  This must be called
-# before reporting any test result; in fact, it must be called before
-# emitting anything on standard output.
-plan_ ()
+# not COMMAND [ARGS...]
+# ---------------------
+# Run the given command and invert its exit status.
+not ()
 {
-  echo "1..$1"
-  have_tap_plan_=yes
+  if "$@"; then return 1; else return 0; fi
 }
 
-# late_plan_
-# ----------
-# Print a TAP plan that accounts for the number of tests seen so far.
-# This must be called after all the tests result have been reported;
-# in fact, after this has been called, nothing more can be print on
-# standard output.
-late_plan_ ()
+# plan_ [unknown|later|lazy|now|NUMBER-OF-PLANNED-TESTS]
+# ------------------------------------------------------
+# Print a TAP plan for the given number of tests.  This must be called
+# before reporting any test result.  If called with the special argument
+# "unknown" or "later", it will do nothing, expecting the calling script
+# to declare the plan later.  If called with the special argument "lazy"
+# or "now", it will print a TAP plan that accounts for the number of tests
+# seen so far.
+plan_ ()
 {
-  echo "1..$tap_count_"
-  have_tap_plan_=yes
+  if test $# -eq 0; then
+    bailout_ "plan_: missing argument"
+  elif test $# -ge 2; then
+    bailout_ "plan_: too many arguments"
+  elif test x"$1" = x"unknown" || test x"$1" = x"later"; then
+    : No-op.
+  elif test x"$1" = x"lazy" || test x"$1" = x"now"; then
+    echo "1..$tap_count_" # Number of test results seen so far.
+    have_tap_plan_=yes
+  elif test $1 -ge 0; then
+    echo "1..$1"
+    have_tap_plan_=yes
+  else
+    bailout_ "plan_: invalid argument '$1'"
+  fi
 }
-
-# Initialize it to avoid interferences from the environment.
-have_tap_plan_=no
+have_tap_plan_=no # Avoid interferences from the environment.
 
 # diag_ [EXPLANATION]
 # ------------------
@@ -139,30 +149,10 @@ result_ ()
   set -x # Restore shell xtraces.
 }
 
-# ok_ [DESCRIPTION...]
-# --------------------
-# Report a successful test.
-ok_ ()
-{
-  result_ 'ok' -- ${1+"$@"}
-}
-
-# not_ok_ [DESCRIPTION...]
-# ------------------------
-# Report a failed test.
-not_ok_ ()
-{
-  result_ 'not ok' -- ${1+"$@"}
-}
-
-# skip_ [-r REASON] [--] [DESCRIPTION...]
-# ---------------------------------------
-# Report a skipped test.  If the `-r' option is present, its argument is
-# give as the reason of the skip.
-skip_ ()
-{
-  result_ 'ok' -D SKIP ${1+"$@"}
-}
+#  Shorthands for common usages of `result_'.
+ok_ () { result_ 'ok' ${1+"$@"}; }
+not_ok_ () { result_ 'not ok' ${1+"$@"}; }
+skip_ () { result_ 'ok' -D SKIP ${1+"$@"}; }
 
 # skip_row_ COUNT [-r REASON] [--] [DESCRIPTION...]
 # -------------------------------------------------
@@ -175,24 +165,6 @@ skip_row_ ()
   for i_ in `seq $skip_count_`; do skip_ ${1+"$@"}; done
 }
 
-# xfail_ [-r REASON] [DESCRIPTION...]
-# ----------------------------------
-# Report a test that failed expectedly.  If the `-r' option is present, its
-# argument is give as the reason why the failure is expected.
-xfail_ ()
-{
-  result_ 'not ok' -D TODO ${1+"$@"}
-}
-
-# xpass_ [-r REASON] [DESCRIPTION...]
-# -----------------------------------
-# Report a test that failed unexpectedly.  If the `-r' option is present, its
-# argument is give as the reason why the failure is expected.
-xpass_ ()
-{
-  result_ 'ok' -D TODO ${1+"$@"}
-}
-
 # skip_all_ [REASON ...]
 # ----------------------
 # Skip all the tests in a test script.  Must be used before calling `plan_'
@@ -233,44 +205,28 @@ framework_failure_ ()
   bailout_ "set-up failure"${1+": $*"}
 }
 
-# command_ok_ TEST-DESCRIPTION [--] CMD [ARGS...]
-# -----------------------------------------------
-# Report a passed test if the given command returns with success,
-# a failed test otherwise.
+# command_ok_ TEST-DESCRIPTION [OPTIONS..] [--] CMD [ARGS...]
+# -----------------------------------------------------------
+# Helper subroutine for when a TAP result must be determined by the
+# outcome of a command.
 command_ok_ ()
 {
-  tap_desc_=$1; shift
-  test x"$1" != x"--" || shift
-  if "$@"; then
-    ok_ "$tap_desc_"
-  else
-    not_ok_ "$tap_desc_"
-  fi
-}
-
-# command_not_ok_ TEST-DESCRIPTION [--] CMD [ARGS...]
-# ---------------------------------------------------
-# Report a failed test if the given command returns with success,
-# a failed test otherwise.
-command_not_ok_ ()
-{
-  tap_desc_=$1; shift
-  test x"$1" != x"--" || shift
-  if "$@"; then
-    not_ok_ "$tap_desc_"
-  else
-    ok_ "$tap_desc_"
-  fi
-}
-
-# reset_test_count_ COUNT
-# -----------------------
-# Reset the count of the TAP test results seen so far to COUNT.
-# This function is for use in corner cases only (e.g., when `ok_' and
-# `not_ok_' must be used inside a subshell).  Be careful when using it!
-reset_test_count_ ()
-{
-  tap_count_=$1
+  tap_directive_= tap_reason_=
+  test $# -gt 0 || bailout_ "command_ok_: missing argument"
+  tap_description_=$1; shift
+  while test $# -gt 0; do
+    case $1 in
+      -D|--directive) tap_directive_=$2; shift;;
+      -r|--reason) tap_reason_=$2; shift;;
+      --) shift; break;;
+      -*) bailout_ "command_ok_: invalid option '$1'";;
+       *) break;;
+    esac
+    shift
+  done
+  tap_result_="ok"; "$@" || tap_result_="not ok"
+  result_ "$tap_result_" -D "$tap_directive_" -r "$tap_reason_" \
+          -- "$tap_description_"
 }
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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