automake-commit
[Top][All Lists]
Advanced

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

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


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-1296-gd1fc9fc
Date: Tue, 06 Sep 2011 21:52:16 +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=d1fc9fcd554fccdac65a0e57c067d1fe55ad5cf7

The branch, testsuite-work has been updated
       via  d1fc9fcd554fccdac65a0e57c067d1fe55ad5cf7 (commit)
       via  af6352fd3d75e92cc9e476a14d902527f67f71ef (commit)
       via  b5f256bcbe38d72d1f69cee806d8714c9c7d0b17 (commit)
       via  c605c816f97609c6b55765a1c8916fdb082dccca (commit)
       via  e1177186ff44b11d6c14d74637bb2564b84151d0 (commit)
      from  9b85896d1902e77dfda90a311e5115078c474c2b (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 d1fc9fcd554fccdac65a0e57c067d1fe55ad5cf7
Author: Stefano Lattarini <address@hidden>
Date:   Tue Sep 6 23:38:47 2011 +0200

    tests: more use of TAP in our own testsuite
    
    * tests/parallel-tests-interrupt.test: Renamed ...
    * tests/parallel-tests-interrupt.tap: ... to this, and converted
    to the use of TAP protocol.
    * tests/self-check-cleanup.test: Renamed ...
    * tests/self-check-cleanup.tap: ... to this, and converted to the
    use of TAP protocol.
    * tests/self-check-dir.test: Renamed ...
    * tests/self-check-dir.tap: ... to this, and converted to the use
    of TAP protocol.
    * tests/self-check-is_newest.test: Renamed ...
    * tests/self-check-is_newest.tap: ... to this, and converted to
    the use of TAP protocol.
    * tests/self-check-unindent.test: Renamed ...
    * tests/self-check-unindent.tap: ... to this, and converted to
    the use of TAP protocol.
    * tests/list-of-tests.mk: Update.

commit af6352fd3d75e92cc9e476a14d902527f67f71ef
Author: Stefano Lattarini <address@hidden>
Date:   Tue Sep 6 18:06:35 2011 +0200

    self tests: sanity check on 'is_blocked_signal' function
    
    * tests/self-check-is-blocked-signal.tap: New test.
    * tests/list-of-tests.mk: Update.

commit b5f256bcbe38d72d1f69cee806d8714c9c7d0b17
Merge: 9b85896 c605c81
Author: Stefano Lattarini <address@hidden>
Date:   Tue Sep 6 17:53:29 2011 +0200

    Merge branch 'test-protocols' into testsuite-work
    
    * test-protocols:
      tests: fix spurious failures due to ignored signals

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

Summary of changes:
 ChangeLog                                          |   37 +++++++
 tests/Makefile.in                                  |   11 +-
 tests/defs                                         |    9 ++
 tests/list-of-tests.mk                             |   11 +-
 ...interrupt.test => parallel-tests-interrupt.tap} |   50 +++++++---
 ...f-check-cleanup.test => self-check-cleanup.tap} |  101 ++++++++++++--------
 tests/self-check-dir.tap                           |   72 ++++++++++++++
 tests/self-check-dir.test                          |   66 -------------
 tests/self-check-exit.tap                          |    4 +
 ...color.test => self-check-is-blocked-signal.tap} |   16 ++-
 ...eck-is_newest.test => self-check-is_newest.tap} |   39 ++++----
 ...check-unindent.test => self-check-unindent.tap} |   66 +++++++-------
 12 files changed, 295 insertions(+), 187 deletions(-)
 rename tests/{parallel-tests-interrupt.test => parallel-tests-interrupt.tap} 
(62%)
 rename tests/{self-check-cleanup.test => self-check-cleanup.tap} (53%)
 create mode 100755 tests/self-check-dir.tap
 delete mode 100755 tests/self-check-dir.test
 copy tests/{tap-summary-color.test => self-check-is-blocked-signal.tap} (72%)
 rename tests/{self-check-is_newest.test => self-check-is_newest.tap} (77%)
 rename tests/{self-check-unindent.test => self-check-unindent.tap} (76%)

diff --git a/ChangeLog b/ChangeLog
index d7514e0..c1d9365 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,40 @@
+2011-09-06  Stefano Lattarini  <address@hidden>
+
+       tests: more use of TAP in our own testsuite
+       * tests/parallel-tests-interrupt.test: Renamed ...
+       * tests/parallel-tests-interrupt.tap: ... to this, and converted
+       to the use of TAP protocol.
+       * tests/self-check-cleanup.test: Renamed ...
+       * tests/self-check-cleanup.tap: ... to this, and converted to the
+       use of TAP protocol.
+       * tests/self-check-dir.test: Renamed ...
+       * tests/self-check-dir.tap: ... to this, and converted to the use
+       of TAP protocol.
+       * tests/self-check-is_newest.test: Renamed ...
+       * tests/self-check-is_newest.tap: ... to this, and converted to
+       the use of TAP protocol.
+       * tests/self-check-unindent.test: Renamed ...
+       * tests/self-check-unindent.tap: ... to this, and converted to
+       the use of TAP protocol.
+       * tests/list-of-tests.mk: Update.
+
+2011-09-06  Stefano Lattarini  <address@hidden>
+
+       self tests: sanity check on 'is_blocked_signal' function
+       * tests/self-check-is-blocked-signal.tap: New test.
+       * tests/list-of-tests.mk: Update.
+
+2011-09-06  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failures due to ignored signals
+       * tests/defs (is_blocked_signal): New function.
+       * tests/parallel-tests-interrupt.test: Do not try to use/trap
+       signals that are ignored by the parent shell: they will be
+       ignored by all the child processes too.
+       * tests/self-check-exit.test: Likewise.
+       * tests/self-check-cleanup.test: Likewise, and do few minor
+       improvements and extensions since we are at it.
+
 2011-09-05  Peter Rosin  <address@hidden>
 
        * tests/amhello-binpkg.test: Add missing $EXEEXT usage.
diff --git a/tests/Makefile.in b/tests/Makefile.in
index e2d3af8..556bf86 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -958,7 +958,7 @@ parallel-tests-fd-redirect.test \
 parallel-tests-extra-programs.test \
 parallel-tests-unreadable.test \
 parallel-tests-subdir.test \
-parallel-tests-interrupt.test \
+parallel-tests-interrupt.tap \
 parallel-tests-reset-term.test \
 parallel-tests-harderror.test \
 parallel-tests-log-override-1.test \
@@ -1123,19 +1123,20 @@ reqd.test \
 reqd2.test \
 repeated-options.test \
 rulepat.test \
-self-check-cleanup.test \
-self-check-dir.test \
+self-check-cleanup.tap \
+self-check-dir.tap \
 self-check-env-sanitize.tap \
 self-check-exit.tap \
 self-check-explicit-skips.test \
-self-check-is_newest.test \
+self-check-is_newest.tap \
 self-check-me.tap \
 self-check-reexec.test \
 self-check-report.test \
 self-check-sanity.test \
 self-check-seq.test \
+self-check-is-blocked-signal.tap \
 self-check-tap.test \
-self-check-unindent.test \
+self-check-unindent.tap \
 sanity.test \
 scripts.test \
 seenc.test \
diff --git a/tests/defs b/tests/defs
index 671ce6f..931188b 100644
--- a/tests/defs
+++ b/tests/defs
@@ -222,6 +222,15 @@ is_newest ()
   test -z "$is_newest_files"
 }
 
+# is_blocked_signal SIGNAL-NUMBER
+# --------------------------------
+# Return success if the given signal number is blocked in the shell,
+# return a non-zero exit status and print a proper diagnostic otherwise.
+is_blocked_signal ()
+{
+  $SHELL -c "kill -$1 \$\$; echo '$me: signal $1 seems blocked'"
+}
+
 # AUTOMAKE_run [-e STATUS] [-d DESCRIPTION] [--] [AUTOMAKE-ARGS...]
 # -----------------------------------------------------------------
 # Run automake with AUTOMAKE-ARGS, and fail if it doesn't exit with
diff --git a/tests/list-of-tests.mk b/tests/list-of-tests.mk
index 073c06c..4783b09 100644
--- a/tests/list-of-tests.mk
+++ b/tests/list-of-tests.mk
@@ -633,7 +633,7 @@ parallel-tests-fd-redirect.test \
 parallel-tests-extra-programs.test \
 parallel-tests-unreadable.test \
 parallel-tests-subdir.test \
-parallel-tests-interrupt.test \
+parallel-tests-interrupt.tap \
 parallel-tests-reset-term.test \
 parallel-tests-harderror.test \
 parallel-tests-log-override-1.test \
@@ -798,19 +798,20 @@ reqd.test \
 reqd2.test \
 repeated-options.test \
 rulepat.test \
-self-check-cleanup.test \
-self-check-dir.test \
+self-check-cleanup.tap \
+self-check-dir.tap \
 self-check-env-sanitize.tap \
 self-check-exit.tap \
 self-check-explicit-skips.test \
-self-check-is_newest.test \
+self-check-is_newest.tap \
 self-check-me.tap \
 self-check-reexec.test \
 self-check-report.test \
 self-check-sanity.test \
 self-check-seq.test \
+self-check-is-blocked-signal.tap \
 self-check-tap.test \
-self-check-unindent.test \
+self-check-unindent.tap \
 sanity.test \
 scripts.test \
 seenc.test \
diff --git a/tests/parallel-tests-interrupt.test 
b/tests/parallel-tests-interrupt.tap
similarity index 62%
rename from tests/parallel-tests-interrupt.test
rename to tests/parallel-tests-interrupt.tap
index ed40412..2acb814 100755
--- a/tests/parallel-tests-interrupt.test
+++ b/tests/parallel-tests-interrupt.tap
@@ -22,6 +22,8 @@
 parallel_tests=yes
 . ./defs || Exit 1
 
+plan_ 16
+
 cat >> configure.in << 'END'
 AC_OUTPUT
 END
@@ -31,7 +33,7 @@ TESTS = foo.test
 ## Provide more debugging info.
 TEST_LOG_COMPILER = $(SHELL) -x
 ## Required by foo.test; see below.
-AM_TESTS_FD_REDIRECT = 9>&2
+AM_TESTS_FD_REDIRECT = 9>&1
 END
 
 # This is hacky and ugly, but has the great advantage of avoiding us a lot
@@ -44,36 +46,54 @@ END
 
 cat > foo.test << 'END'
 #!/bin/sh
-exec 2>&9
+
 echo "foo is starting to run"
-ls -l >&2
-cat foo.log >&2 || : > fail
-grep '^foo is starting to run$' foo.log >&2 || : > fail
-cat pid >&2 || : > fail
-kill -$signum `cat pid` || : > fail
+
+ls -l >&9 || exit 99
+
+test $sig -gt 0 || {
+  echo "Bailout! \$sig not exported to test script" >&9
+  exit 99
+}
+
+res=ok; cat foo.log >&9 || res="not ok"
+echo "$res - logfile created and readable [SIG $sig]" >&9
+
+res=ok; grep '^foo is starting to run$' foo.log >&2 || res='not ok'
+echo "$res - logfile contains output from test script [SIG $sig]" >&9
+
+cat pid >&9 \
+  || echo "Bailout! cannot get PID of test driver" >&9
+kill -$sig `cat pid` \
+  || echo "Bailout! cannot send signal $sig to test driver" >&9
 END
 chmod a+x foo.test
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
+$ACLOCAL  || fatal_ "aclocal failed"
+$AUTOCONF || fatal_ "autoconf failed"
+$AUTOMAKE || fatal_ "automake failed"
 
-./configure
+./configure || fatal_ "./configure failed"
 
 # The only signals that can be trapped portable are 1 "SIGHUP",
 # 2 "SIGINT", 13 "SIGPIPE" and 15 "SIGTERM".
 trapped_signals='1 2 13 15'
 
-for signum in $trapped_signals; do
+for sig in $trapped_signals; do
+  if is_blocked_signal $sig; then
+    for i in 1 2 3 4; do echo "ok # SKIP signal $sig is blocked"; done
+    continue
+  fi
   rm -f pid fail *.log
-  env signum=$signum $MAKE check && { ls -l; Exit 1; }
+  r=ok; env sig=$sig $MAKE check && r='not ok'
+  echo "$r - signal $sig to test driver causes \"make check\" to fail"
   ls -l
   # These files shouldn't exist, but in case they do, their content might
   # provide helpful information about the causes of the failure(s).
   cat foo.log || :
   cat test-suite.log || :
-  test -f fail && Exit 1
-  ls | $EGREP 'foo.*\.(log|tmp)' && Exit 1
+  r=ok; ls | $EGREP 'foo.*\.(log|tmp)' && r='not ok'
+  echo "$r - test driver clean up log and tmp files after signal $sig"
 done
 
 :
diff --git a/tests/self-check-cleanup.test b/tests/self-check-cleanup.tap
similarity index 53%
rename from tests/self-check-cleanup.test
rename to tests/self-check-cleanup.tap
index fb5b055..c9d0bc9 100755
--- a/tests/self-check-cleanup.test
+++ b/tests/self-check-cleanup.tap
@@ -20,19 +20,24 @@
 . ./defs || Exit 1
 
 if test x"$sh_errexit_works" != x"yes"; then
-  skip_ "$me: no working exit trap with 'set -e'"
+  skip_all_ "$me: no working exit trap with 'set -e'"
 fi
 
+plan_ 42
+
 # We still need a little hack to make ./defs work outside automake's
 # tree `tests' subdirectory.  Not a big deal.
 sed "s|^testbuilddir=.*|testbuilddir='`pwd`'|" ../defs-static >defs-static
-diff ../defs-static defs-static && Exit 99
+diff ../defs-static defs-static && fatal_ "failed to edit defs-static"
 cp ../defs .
 
 AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
 
-have_symlinks=false
-ln -s defs foo && have_symlinks=:
+if ln -s defs foo; then
+  have_symlinks=yes
+else
+  have_symlinks=no
+fi
 export have_symlinks # Is used also by spawned shells.
 
 dir=dummy.dir
@@ -42,28 +47,29 @@ dir=dummy.dir
 mkdir $dir $dir/sub
 cd $dir
 touch file sub/file
-if $have_symlinks; then
+if test $have_symlinks = yes; then
   ln -s file symlink
   ln -s none brokenlink
 fi
 cd ..
 chmod 000 $dir/sub/* $dir/file $dir/symlink
 chmod 000 $dir/sub $dir
-$SHELL -c  '. ./defs' dummy.test
-test ! -f $dir
-test ! -d $dir
-test ! -r $dir
+command_ok_ "pre-cleanup can deal with null-perms testdir" \
+            $SHELL -c  '. ./defs' dummy.test
+command_ok_ "pre-cleanup removed null-perms testdir"
+            eval 'test ! -f $dir && test ! -d $dir && test ! -r $dir'
 
 # Check that post-test cleanup works also with directories with
 # "null" permissions, and containing broken symlinks.
-$SHELL -c '
+command_ok_ "post-cleanup can deal with null-perms testdir" \
+            $SHELL -c  '
   stderr_fileno_=2
   . ./defs || Exit 1
   set -e
   mkdir dir dir/sub
   cd dir
   touch file sub/file
-  if $have_symlinks; then
+  if test $have_symlinks = yes; then
     ln -s file symlink
     ln -s none brokenlink
   fi
@@ -72,13 +78,12 @@ $SHELL -c '
   chmod 000 dir/sub dir
   :
 ' dummy.test
-test ! -f $dir
-test ! -d $dir
-test ! -r $dir
+command_ok_ "post-cleanup removed null-perms testdir"
+            eval 'test ! -f $dir && test ! -d $dir && test ! -r $dir'
 
 # Check that pre-test cleanup does not unduly change the permissions of
 # files to which symlinks in the temporary test directory point to.
-if $have_symlinks; then
+if test $have_symlinks = yes; then
 
   mkdir dir
   chmod 000 dir
@@ -89,51 +94,65 @@ if $have_symlinks; then
   cd $dir
   ln -s ../dir ../file .
   cd ..
-  $SHELL -c '. ./defs' dummy.test
+
+  command_ok_ "pre-cleanup with testdir with zero-perms symlinks" \
+               $SHELL -c '. ./defs' dummy.test
   ls -l # For debugging.
-  ls -l file | grep "^----------.*file"
-  ls -ld dir | grep "^d---------.*dir"
+  command_ok_ "pre-cleanup chmod doesn't follow symlinks to files" \
+               eval 'ls -l file | grep "^----------.*file"'
+  command_ok_ "pre-cleanup chmod doesn't follow symlinks to dirs" \
+              eval 'ls -ld dir | grep "^d---------.*dir"'
 
-  $SHELL -c '
+  command_ok_ "post-cleanup with testdir with zero-perms symlinks" \
+              $SHELL -c '
     ocwd=`pwd` || exit 1
     stderr_fileno_=2
     . ./defs || Exit 1
     ln -s "$ocwd/dir" "$ocwd/file" .
   ' dummy.test
   ls -l # For debugging.
-  ls -l file | grep "^----------.*file"
-  ls -ld dir | grep "^d---------.*dir"
+  command_ok_ "post-cleanup chmod doesn't follow symlinks to files" \
+               eval 'ls -l file | grep "^----------.*file"'
+  command_ok_ "post-cleanup chmod doesn't follow symlinks to dirs" \
+              eval 'ls -ld dir | grep "^d---------.*dir"'
 
   rmdir dir
   rm -f file
 
-fi # $have_symlinks
+else # $have_symlinks = no
+  skip_row_ 6 "symlinks not supported"
+fi
 
 # Check that the cleanup trap does not remove the temporary
 # test directory in case of test failure, skip, hard-error,
 # or when receiving a signal.
-for bailout_command in \
-  'Exit 1' \
-  'Exit 2' \
-  'Exit 10' \
-  'Exit 77' \
-  'Exit 99' \
-  'Exit 126' \
-  'Exit 127' \
-  'Exit 255' \
-  'kill -1 $$' \
-  'kill -2 $$' \
-  'kill -9 $$' \
-  'kill -13 $$' \
-  'kill -15 $$' \
-; do
-  $SHELL -c  "
+
+for st in 1 2 3 10 77 99 126 127 130 255; do
+  command_ok_ "exit trap doesn't clobber exit status $st" not $SHELL -c "
+    stderr_fileno_=2
+    . ./defs
+    : > foo
+    Exit $st
+  " dummy.test
+  command_ok_ "testdir not removed if exiting with status $st" \
+              test -f dummy.dir/foo
+  rm -rf dummy.dir
+done
+
+for sig in 1 2 3 9 13 15; do
+  if is_blocked_signal $sig; then
+    skip_row_ 2 -r "signal $sig seems blocked"
+    continue
+  fi
+  command_ok_ "exit trap doesn't clobber signal $sig" not $SHELL -c "
     stderr_fileno_=2
     . ./defs
     : > foo
-    $bailout_command
-  " dummy.test && Exit 1
-  test -f dummy.dir/foo
+    kill -$sig \$\$
+  " dummy.test
+  command_ok_ "testdir not removed if getting signal $sig" \
+              test -f dummy.dir/foo
+  rm -rf dummy.dir
 done
 
 :
diff --git a/tests/self-check-dir.tap b/tests/self-check-dir.tap
new file mode 100755
index 0000000..e698b0c
--- /dev/null
+++ b/tests/self-check-dir.tap
@@ -0,0 +1,72 @@
+#! /bin/sh
+# Copyright (C) 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/>.
+
+# Sanity check for the automake testsuite.
+# Check that tests using `./defs' create a proper temporary directory,
+# and run in it.  Also check that we can prevent the pre-population
+# and the creation of such directory if we want.
+
+am_create_testdir=no
+. ./defs || Exit 99
+
+plan_ 5
+
+AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
+
+# This needs to be consistent with what $SHELL deems to be the
+# current working directory.
+cwd=`$SHELL -c 'pwd'` || fatal_ "can't get current working directory"
+echo "$cwd"
+
+do_check ()
+{
+  test ! -d _self.dir || rm -rf _self.dir \
+    || framework_failure_ "cleaning up _self.dir"
+  command_ok_ "$1 [$2]" $SHELL -c "
+    $2
+    . ./defs || Exit 99
+    pwd; ls -l; # For debugging.
+    $3
+  " _self.test
+}
+
+do_check 'testdir has the expected path' \
+         'unset am_create_testdir' \
+         'case `pwd` in '"$cwd"'/_self.dir);; *) Exit 1;; esac'
+
+do_check 'fully pre-populated testdir' \
+         'unset am_create_testdir' \
+         'test -f install-sh || Exit 1
+          test -f configure.in || Exit 1
+          case `pwd` in '"$cwd"'/_self.dir) : ;; *) Exit 1;; esac'
+
+do_check 'testdir has the expected path' \
+         'am_create_testdir=empty' \
+         'case `pwd` in '"$cwd"'/_self.dir) : ;; *) Exit 1;; esac'
+
+do_check 'do not pre-populate testdir' \
+         'am_create_testdir=empty' \
+         'ls -a | grep -v "^\\.\\{1,2\\}$" | grep . && Exit 1; :'
+
+do_check 'do not create nor chdir in testdir' \
+         'am_create_testdir=no' \
+         'test ! -d _self.dir || Exit 1
+          test ! -f _self.dir || Exit 1
+          test ! -r _self.dir || Exit 1
+          test -f self-check-dir.tap || Exit 1
+          case `pwd` in '"$cwd"') : ;; *) Exit 1;; esac'
+
+:
diff --git a/tests/self-check-dir.test b/tests/self-check-dir.test
deleted file mode 100755
index 1aae601..0000000
--- a/tests/self-check-dir.test
+++ /dev/null
@@ -1,66 +0,0 @@
-#! /bin/sh
-# Copyright (C) 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/>.
-
-# Sanity check for the automake testsuite.
-# Check that tests using `./defs' create a proper temporary directory,
-# and run in it.  Also check that we can prevent the pre-population
-# and the creation of such directory if we want.
-
-. ./defs-static || exit 1
-
-set -ex
-AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
-
-# This needs to be consistent with what $SHELL deems to be the
-# current working directory.
-cwd=`$SHELL -c 'pwd'` || exit 99
-echo "$cwd"
-
-rm -f _self.tmp
-
-st=0
-$SHELL -c '
-  . ./defs || Exit 1
-  pwd; ls -l; # For debugging.
-  : > _self.tmp
-  test -f install-sh
-  test -f configure.in
-  case `pwd` in '"$cwd"'/_self.dir);; *) Exit 1;; esac
-' _self.test || st=1
-test -f _self.tmp && { rm -f _self.tmp; st=1; }
-test $st -eq 0 || exit 1
-
-st=0
-$SHELL -c '
-  am_create_testdir=empty
-  . ./defs || Exit 1
-  pwd; ls -l; # For debugging.
-  ls -a | grep -v "^\\.\\{1,2\\}$" | grep . && Exit 1
-  : > _self.tmp
-  case `pwd` in '"$cwd"'/_self.dir);; *) Exit 1;; esac
-  :
-' _self.test || st=1
-test -f _self.tmp && { rm -f _self.tmp; st=1; }
-test $st -eq 0 || exit 1
-
-$SHELL -c '
-  am_create_testdir=no
-  . ./defs || Exit 1
-  test -f self-check-dir.test
-  case `pwd` in '"$cwd"');; *) Exit 1;; esac
-' _self.test || exit 1
-
-:
diff --git a/tests/self-check-exit.tap b/tests/self-check-exit.tap
index 6f35e08..563500b 100755
--- a/tests/self-check-exit.tap
+++ b/tests/self-check-exit.tap
@@ -41,6 +41,10 @@ for st in 1 2 3 4 5 77 99 126 127 128 129 130 255; do
 done
 
 for sig in 1 2 13 15; do
+  if is_blocked_signal $sig; then
+    skip_ -r "signal $sig seems blocked"
+    continue
+  fi
   if test $sig -eq 2; then
     # Some Korn shells might otherwise get a spurious SIGINT
     # signal when one is sent to the child $SHELL.
diff --git a/tests/tap-summary-color.test 
b/tests/self-check-is-blocked-signal.tap
similarity index 72%
copy from tests/tap-summary-color.test
copy to tests/self-check-is-blocked-signal.tap
index 2dacb54..ba20488 100755
--- a/tests/tap-summary-color.test
+++ b/tests/self-check-is-blocked-signal.tap
@@ -14,10 +14,16 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# TAP support:
-#  - colorized testsuite summary
+# Sanity check for the automake testsuite: the `signal_is_blocked'
+# shell function.
 
-. ./defs-static
+am_create_testdir=no
+. ./defs || Exit 99
 
-use_colors=yes
-. "$testsrcdir"/tap-summary-aux.sh
+plan_ 2
+
+command_ok_ "unblockable signal 9" not is_blocked_signal 9
+trap "" 13
+command_ok_ "blocked signal 13" is_blocked_signal 13
+
+:
diff --git a/tests/self-check-is_newest.test b/tests/self-check-is_newest.tap
similarity index 77%
rename from tests/self-check-is_newest.test
rename to tests/self-check-is_newest.tap
index 4e4e315..a41765d 100755
--- a/tests/self-check-is_newest.test
+++ b/tests/self-check-is_newest.tap
@@ -14,11 +14,16 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Sanity check for the automake testsuite.
-# Check the `is_newest' subroutine.
+# Sanity check for the automake testsuite: the `is_newest' subroutine.
 
 . ./defs || Exit 1
 
+plan_ 21
+
+# I'm a lazy typist.
+Y () { command_ok_ "is_newest $*" is_newest "$@"; }
+N () { command_ok_ "not is_newest $*" not is_newest "$@"; }
+
 : > a
 $sleep
 : > b
@@ -26,18 +31,18 @@ $sleep
 
 stat a b c || : # For debugging.
 
-is_newest c a
-is_newest b a
-is_newest a b && Exit 1
-is_newest c b
-is_newest c c
-is_newest c a b c
+Y c a
+Y b a
+N a b
+Y c b
+Y c c
+Y c a b c
 
 touch -r c d
 
 stat c d || : # For debugging.
 
-is_newest c d
+Y c d
 
 # Should work on directories too, both empty and not-empty.  An older
 # implementation of `is_newest' failed if the first argument was a
@@ -56,20 +61,20 @@ stat u v x y x/foo y/foo || : # For debugging.
 
 for older in u x; do
   for newer in v y; do
-    is_newest $newer $older
-    is_newest $older $newer && Exit 1
+    Y $newer $older
+    N $older $newer
   done
 done
 
-is_newest x/foo x
-is_newest x x/foo && Exit 1
+Y x/foo x
+N x x/foo
 
 touch -r x u
-is_newest x u
-is_newest u x
+Y x u
+Y u x
 
 # A couple of mild "stress" tests.
-is_newest y x u v
-is_newest y u x/foo a b c
+Y y x u v
+Y y u x/foo a b c
 
 :
diff --git a/tests/self-check-unindent.test b/tests/self-check-unindent.tap
similarity index 76%
rename from tests/self-check-unindent.test
rename to tests/self-check-unindent.tap
index 0a0f86f..517224a 100755
--- a/tests/self-check-unindent.test
+++ b/tests/self-check-unindent.tap
@@ -19,9 +19,27 @@
 
 . ./defs || Exit 1
 
+plan_ 22
+
+#------------------------------------------------------------------
+
+will_test () { tst=$*; }
+
+do_check ()
+{
+  command_ok_ "$tst [simple, exit status]" \
+              eval 'unindent input > got'
+  command_ok_ "$tst [simple, output]" \
+              diff exp got
+  command_ok_ "$tst [parallel, exit status]" \
+              eval 'unindent input | unindent > got'
+  command_ok_ "$tst [parallel, output]" \
+              diff exp got
+}
+
 #------------------------------------------------------------------
 
-: Leading spaces.
+will_test 'leading spaces'
 
 cat > input <<END
   1
@@ -73,15 +91,11 @@ ${tab}
 last line
 END
 
-unindent input > got
-diff exp got
-
-unindent input | unindent > got
-diff exp got
+do_check
 
 #------------------------------------------------------------------
 
-: Leading tab.
+will_test 'leading tab'
 
 cat > input <<END
 ${tab}1
@@ -131,15 +145,11 @@ ${sp}${tab}
 last line
 END
 
-unindent input > got
-diff exp got
-
-unindent input | unindent > got
-diff exp got
+do_check "leading tab"
 
 #------------------------------------------------------------------
 
-: No leading whitespace.
+will_test 'no leading whitespace'
 
 cat > input <<END
 1
@@ -164,15 +174,11 @@ END
 
 cp input exp
 
-unindent input > got
-diff exp got
-
-unindent input | unindent > got
-diff exp got
+do_check
 
 #------------------------------------------------------------------
 
-: Leading empty lines are ignored [1].
+will_test 'leading empty lines ignored (1)'
 
 cat > input <<END
 
@@ -190,15 +196,11 @@ bar
   quux
 END
 
-unindent input > got
-diff exp got
-
-unindent input | unindent > got
-diff exp got
+do_check
 
 #------------------------------------------------------------------
 
-: Leading empty lines are ignored [2].
+will_test 'leading empty lines ignored (2)'
 
 cat > input <<END
 
@@ -216,15 +218,11 @@ bar
    quux
 END
 
-unindent input > got
-diff exp got
-
-unindent input | unindent > got
-diff exp got
+do_check
 
 #------------------------------------------------------------------
 
-: More elaborated parallel use.
+will_test 'more elaborated parallel use'
 
 cat > input <<END
   x
@@ -249,7 +247,9 @@ c
 ${tab}f
 END
 
-unindent input | sed 1d | unindent > got
-diff exp got
+command_ok_ "$tst [exit status]" \
+            eval 'unindent input | sed 1d | unindent > got'
+
+command_ok_ "$tst [output]" diff exp got
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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