automake-patches
[Top][All Lists]
Advanced

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

[FYI 4/7] {tap-testsuite-work} self tests: register an expected failures


From: Stefano Lattarini
Subject: [FYI 4/7] {tap-testsuite-work} self tests: register an expected failures with Solaris /bin/sh
Date: Tue, 9 Aug 2011 15:35:32 +0200

Solaris 10 /bin/sh erroneously exit with success right away when
the following three conditions are met at the same time:
 1. the `errexit' flag is active,
 2. an exit trap is installed, and
 3. a non-existing command is issued.

* tests/self-exit.tap: When that bug is detected, issue an XFAIL
rather than a FAIL.  Since we are at it, improve by avoiding
creation of stray temporary files when testing for non-executable
commands.
---
 ChangeLog                 |   13 +++++++++++++
 tests/self-check-exit.tap |   25 +++++++++++++++++++++----
 2 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 73c3b25..97b0ae5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2011-08-09  Stefano Lattarini  <address@hidden>
 
+       self tests: register an expected failures with Solaris /bin/sh
+       Solaris 10 /bin/sh erroneously exit with success right away when
+       the following three conditions are met at the same time:
+        1. the `errexit' flag is active,
+        2. an exit trap is installed, and
+        3. a non-existing command is issued.
+       * tests/self-exit.tap: When that bug is detected, issue an XFAIL
+       rather than a FAIL.  Since we are at it, improve by avoiding
+       creation of stray temporary files when testing for non-executable
+       commands.
+
+2011-08-09  Stefano Lattarini  <address@hidden>
+
        gitignore: update and improve for the testsuite files
        * tests/.gitignore: Don't ignore temporary partial log files,
        autogenerated tests and makefile fragments that are not used
diff --git a/tests/self-check-exit.tap b/tests/self-check-exit.tap
index 97bf3bc..dc8cfda 100755
--- a/tests/self-check-exit.tap
+++ b/tests/self-check-exit.tap
@@ -61,12 +61,29 @@ for sig in 1 2 13 15; do
 done
 
 : Non-existent program.
-rc=0; $SHELL -c  ". ./defs; non-existent-program; :" || rc=$?
-command_ok_ "command not found" test $rc -gt 0
+# Solaris 10 /bin/sh erroneously exit with success right away when the
+# following three conditions are met at the same time:
+#   1. the `errexit' flag is active,
+#   2. an exit trap is installed, and
+#   3. a non-existing command is issued.
+# Note that the non-existent command is issued as the last command to
+# the shell in the next line; this is deliberate.
+if $SHELL -c 'set -e; trap "exit \$?" 0; non-existent-program'; then
+  maybe_todo=TODO reason="known Solaris /bin/sh bug"
+else
+  maybe_todo="" reason=""
+fi
+if $SHELL -c  ". ./defs; non-existent-program; :"; then
+  r='not ok'
+else
+  r='ok'
+fi
+result_ "$r" -D "$maybe_todo" -r "$reason" "command not found"
 
 : Non-executable command.
-: > non-executable
-rc=0; $SHELL -c  ". ./defs; ./non-executable; :" || rc=$?
+test -f Makefile && test ! -x Makefile || \
+  framowork_failure_ "no proper Makefile in the current directory"
+rc=0; $SHELL -c  ". ./defs; ./Makefile; :" || rc=$?
 command_ok_ "permission denied" test $rc -gt 0
 
 : Syntax errors in the test code.
-- 
1.7.2.3




reply via email to

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