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-936-g52b0814
Date: Thu, 16 Jun 2011 13:02:00 +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=52b08141986749bda20ffaf17e6aab145ee6a392

The branch, testsuite-work has been updated
       via  52b08141986749bda20ffaf17e6aab145ee6a392 (commit)
      from  a65acce263dd789f004567857ff56d43d2975a35 (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 52b08141986749bda20ffaf17e6aab145ee6a392
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 16 14:50:50 2011 +0200

    tests: make test 'self-check-reexec.test' more portable
    
    * tests/self-check-reexec.test: Rewrite not to require a Korn
    Shell able to grok variable expansions such as `${.sh.version}';
    Solaris 10 /bin/ksh fails on this for example.  Instead, just
    require bash and a shell that is not bash.

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

Summary of changes:
 ChangeLog                    |    8 ++++++
 tests/self-check-reexec.test |   52 +++++++++++++++++++++++++-----------------
 2 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cce35e5..399e855 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-16  Stefano Lattarini  <address@hidden>
+
+       tests: make test 'self-check-reexec.test' more portable
+       * tests/self-check-reexec.test: Rewrite not to require a Korn
+       Shell able to grok variable expansions such as `${.sh.version}';
+       Solaris 10 /bin/ksh fails on this for example.  Instead, just
+       require bash and a shell that is not bash.
+
 2011-06-14  Stefano Lattarini  <address@hidden>
            Jim Meyering  <address@hidden>
 
diff --git a/tests/self-check-reexec.test b/tests/self-check-reexec.test
index a35c143..2a0fb33 100755
--- a/tests/self-check-reexec.test
+++ b/tests/self-check-reexec.test
@@ -18,47 +18,57 @@
 # Check that automatic re-execution of test script with the
 # configure-time $SHELL.
 
+required=bash
 . ./defs || Exit 1
 
+unset AM_TESTS_REEXEC BASH_VERSION || :
+
 # This is not optimal, but it's much better than writing wrapper
 # scripts acting as "fake" shells.
-sh -c ': ${.sh.version}' \
-  && skip_ "sh is a Korn Shell"
-ksh -c 'test -n "${.sh.version}"' || \
-  skip_ "ksh is not a fully-fledged Korn Shell"
+
+bash -c 'test -n "$BASH_VERSION"' || skip_ "bash shell not found"
+
+for shell in /bin/sh /bin/ksh sh ksh dash pdksh __no_shell__; do
+  test $shell = __no_shell__ && skip_ "can't find any non-bash shell"
+  $shell -c 'test -n "$BASH_VERSION"' && continue
+  break
+done
+echo "shell='$shell'"
 
 cwd=`pwd` || Exit 99
 
 cp ../defs .
-unset AM_TESTS_REEXEC || :
 
 #
 # Check how to default, force or prevent a re-execution.
 #
 
-cat > run-with-ksh.test <<'END'
+cat > run-with-bash.test <<'END'
 #!/bin/false
 . ./defs
-# Subshell required to prevent some shells (e.g., older bash) from
-# only complaining on stderr but then exiting with exit status 0.
-(test -n "${.sh.version}" && echo ${.sh.version})
+# Ensure that the script gets re-executed with bash.  Also ensure that
+# non-standard syntax used after the inclusion of `./defs' doesn't cause
+# non-bash shells to fail.
+# Subshell required to prevent some shells (e.g., Solaris 10 /bin/sh)
+# from only complaining on stderr but then exiting with exit status 0.
+(foo=abac && test xbxc = ${foo//a/x} && test -n "$BASH_VERSION")
 END
 
 sed -e "s|^testbuilddir=.*|testbuilddir='$cwd'|" \
-    -e 's|^SHELL=.*$|SHELL=ksh; export SHELL|' \
+    -e 's|^SHELL=.*$|SHELL=bash; export SHELL|' \
     < ../defs-static >defs-static
 
-sh -x run-with-ksh.test
+$shell -x run-with-bash.test
 
-AM_TESTS_REEXEC=''    sh run-with-ksh.test
-AM_TESTS_REEXEC=yes   sh run-with-ksh.test
-AM_TESTS_REEXEC=y     sh run-with-ksh.test
-AM_TESTS_REEXEC=true  sh run-with-ksh.test
-AM_TESTS_REEXEC=1     sh run-with-ksh.test
-AM_TESTS_REEXEC=no    sh run-with-ksh.test && Exit 1
-AM_TESTS_REEXEC=n     sh run-with-ksh.test && Exit 1
-AM_TESTS_REEXEC=false sh run-with-ksh.test && Exit 1
-AM_TESTS_REEXEC=0     sh run-with-ksh.test && Exit 1
+AM_TESTS_REEXEC=''    $shell run-with-bash.test
+AM_TESTS_REEXEC=yes   $shell run-with-bash.test
+AM_TESTS_REEXEC=y     $shell run-with-bash.test
+AM_TESTS_REEXEC=true  $shell run-with-bash.test
+AM_TESTS_REEXEC=1     $shell run-with-bash.test
+AM_TESTS_REEXEC=no    $shell run-with-bash.test && Exit 1
+AM_TESTS_REEXEC=n     $shell run-with-bash.test && Exit 1
+AM_TESTS_REEXEC=false $shell run-with-bash.test && Exit 1
+AM_TESTS_REEXEC=0     $shell run-with-bash.test && Exit 1
 
 #
 # Check message about the re-execution.
@@ -80,7 +90,7 @@ sed -e "s|^testbuilddir=.*|testbuilddir='$cwd/sub'|" \
 
 ./dummy.test a b | grep "^dummy: exec $SHELL \\./dummy\\.test a b$"
 
-for am_sh in sh ksh; do
+for am_sh in $shell bash; do
   $am_sh dummy.test a b c \
     | grep "^dummy: exec $SHELL dummy\\.test a b c$"
   $am_sh ./dummy.test a b c \


hooks/post-receive
-- 
GNU Automake



reply via email to

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