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-931-gfef8ee8
Date: Thu, 16 Jun 2011 08:19:29 +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=fef8ee88b48851569de5b05768c892914a72b16d

The branch, testsuite-work has been updated
       via  fef8ee88b48851569de5b05768c892914a72b16d (commit)
       via  a25e4646a3563c482cf98e5252c245fbd19c3cbf (commit)
       via  cca31bd5ab44dc0e1bd866e49fcc3354b071718b (commit)
       via  fb4ca27a3992f229def170dffeb2c1c8c23d9478 (commit)
       via  8dbdca111d25761a350c598f7a702c7dc5d3b24b (commit)
       via  5ac7081cc229a57df779a134de5b192c6d3519a7 (commit)
       via  1222bfbc2cbf164f7ece4ff952c6798a1d5eb585 (commit)
      from  1e8dc0f665c2d66d037cbe79c8e036f2d714311e (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 fef8ee88b48851569de5b05768c892914a72b16d
Merge: a25e464 8dbdca1
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 16 10:17:30 2011 +0200

    Merge branch 'tests-more-shells' into testsuite-work

commit a25e4646a3563c482cf98e5252c245fbd19c3cbf
Merge: cca31bd fb4ca27
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 16 10:13:18 2011 +0200

    Merge branch 'extend-coverage-for-add-missing' into testsuite-work

commit cca31bd5ab44dc0e1bd866e49fcc3354b071718b
Author: Stefano Lattarini <address@hidden>
Date:   Sun Jun 12 19:35:53 2011 +0200

    tests: few fixlets and improvements
    
    * tests/cond31.test ($required): Remove `cc', it's not really
    needed.
    * tests/confh.test: Call autoheader too.  The lack of this call
    wasn't causing spurious failures because, when make was called,
    the automatic remake rules somehow ended up invoking it on our
    behalf.
    * tests/fn99subdir.test: Use $subdirname throughout, instead of
    ${subdirname}, for consistency with the rest of the testsuite.
    Avoid an unnecessary subshell, which could also cause spurious
    passes, being guarded by a trailing `|| Exit 1', which neutralize
    the `errexit' flag.  Remove an unnecessary `|| Exit 1' guard.
    * tests/insh2.test: Rewrite to avoid hackish Makefile.in munging,
    and to also run configure and make.

commit fb4ca27a3992f229def170dffeb2c1c8c23d9478
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jun 13 19:42:52 2011 +0200

    tests: extend tests on `--add-missing' and `--copy' a bit
    
    * tests/add-missing.test: Fix typo in heading comments.  Try with
    another testcase that install many (but not all) the auxiliary
    scripts at once, and uses non-standard (but valid and documented)
    setups (e.g., defining YACC in Makefile.am instead of calling
    AC_PROG_YACC from configure.in).
    * tests/copy.test: Reference `add-missing.test' in heading
    comments.  Try few more test scenarios.

commit 8dbdca111d25761a350c598f7a702c7dc5d3b24b
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jun 13 18:19:53 2011 +0200

    tests: remove 'test_prefer_config_shell' from the environment
    
    Since commit `v1.11-910-g7df1a9b', the once user-overridable
    variable `$test_prefer_config_shell' has become an internal
    detail, and the test scripts now complain and bail out if it is
    set in the environment.
    
    * tests/Makefile.am (AM_TESTS_ENVIRONMENT): Unset the variable
    `test_prefer_config_shell' if it is set in the environment.

commit 5ac7081cc229a57df779a134de5b192c6d3519a7
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jun 13 14:48:57 2011 +0200

    tests: autogenerate list of wrapped tests for `lib/' shell scripts
    
    * tests/gen-config-shell-tests: New script, generates distributed
    makefile snippet `tests/config-shell-tests.am' to list all tests
    that use the `get_shell_script' function, with names mangled to
    use suffix `-w.shtst', in ...
    * tests/Makefile.am (config_shell_tests): ... this macro, whose
    definition has been consequently removed from Makefile.am.
    (EXTRA_DIST): Distribute the new script.
    ($(srcdir)/config-shell-tests.am): Generate using the new script.
    (include): Include the `config-shell-tests.am' fragment.
    * bootstrap: Invoke `tests/gen-config-shell-tests' to generate
    `tests/config-shell-tests.am'.
    * tests/.gitignore: Ignore `config-shell-tests.am'.
    * tests/gen-parallel-tests: Fixlet in heading comments.

commit 1222bfbc2cbf164f7ece4ff952c6798a1d5eb585
Author: Stefano Lattarini <address@hidden>
Date:   Mon Jun 13 12:21:52 2011 +0200

    tests: test mdate-sh with /bin/sh too
    
    * tests/mdate5.test: Fetch the `mdate-sh' script using the
    `get_shell_script' function, and run it directly instead of
    using `$SHELL'.
    * tests/mdate6.test: Likewise.  Since we are at it, make checks
    on the `mdate-sh' output stricter, remove now unneeded calls to
    aclocal and automake and creation/extension of `configure.in',
    `Makefile.am' and `textutils.tex' files, and add a trailing `:'
    command.
    * tests/Makefile.am (config_shell_tests): Add `mdate5-w.shtst'
    and `mdate6-w.shtst'.

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

Summary of changes:
 ChangeLog                    |   68 ++++++++++++++++++++++++++++++++++++++++
 bootstrap                    |    1 +
 tests/.gitignore             |    1 +
 tests/Makefile.am            |   25 ++++-----------
 tests/Makefile.in            |   52 +++++++++++++++++--------------
 tests/add-missing.test       |   23 +++++++++++++-
 tests/cond31.test            |    1 -
 tests/confh.test             |    1 +
 tests/copy.test              |   58 ++++++++++++++++++++++++++++++++++
 tests/fn99subdir.test        |   36 +++++++++++----------
 tests/gen-config-shell-tests |   70 ++++++++++++++++++++++++++++++++++++++++++
 tests/gen-parallel-tests     |    8 ++--
 tests/insh2.test             |   15 ++++++--
 tests/mdate5.test            |   33 +++++++++++---------
 tests/mdate6.test            |    5 ++-
 15 files changed, 312 insertions(+), 85 deletions(-)
 create mode 100755 tests/gen-config-shell-tests

diff --git a/ChangeLog b/ChangeLog
index 37c0a69..2029e92 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,73 @@
 2011-06-13  Stefano Lattarini  <address@hidden>
 
+       tests: remove 'test_prefer_config_shell' from the environment
+       Since commit `v1.11-910-g7df1a9b', the once user-overridable
+       variable `$test_prefer_config_shell' has become an internal
+       detail, and the test scripts now complain and bail out if it is
+       set in the environment.
+       * tests/Makefile.am (AM_TESTS_ENVIRONMENT): Unset the variable
+       `test_prefer_config_shell' if it is set in the environment.
+
+2011-06-13  Stefano Lattarini  <address@hidden>
+
+       tests: autogenerate list of wrapped tests for `lib/' shell scripts
+       * tests/gen-config-shell-tests: New script, generates distributed
+       makefile snippet `tests/config-shell-tests.am' to list all tests
+       that use the `get_shell_script' function, with names mangled to
+       use suffix `-w.shtst', in ...
+       * tests/Makefile.am (config_shell_tests): ... this macro, whose
+       definition has been consequently removed from Makefile.am.
+       (EXTRA_DIST): Distribute the new script.
+       ($(srcdir)/config-shell-tests.am): Generate using the new script.
+       (include): Include the `config-shell-tests.am' fragment.
+       * bootstrap: Invoke `tests/gen-config-shell-tests' to generate
+       `tests/config-shell-tests.am'.
+       * tests/.gitignore: Ignore `config-shell-tests.am'.
+       * tests/gen-parallel-tests: Fixlet in heading comments.
+
+2011-06-13  Stefano Lattarini  <address@hidden>
+
+       tests: test mdate-sh with /bin/sh too
+       * tests/mdate5.test: Fetch the `mdate-sh' script using the
+       `get_shell_script' function, and run it directly instead of
+       using `$SHELL'.
+       * tests/mdate6.test: Likewise.  Since we are at it, make checks
+       on the `mdate-sh' output stricter, remove now unneeded calls to
+       aclocal and automake and creation/extension of `configure.in',
+       `Makefile.am' and `textutils.tex' files, and add a trailing `:'
+       command.
+       * tests/Makefile.am (config_shell_tests): Add `mdate5-w.shtst'
+       and `mdate6-w.shtst'.
+
+2011-06-13  Stefano Lattarini  <address@hidden>
+
+       tests: extend tests on `--add-missing' and `--copy' a bit
+       * tests/add-missing.test: Fix typo in heading comments.  Try with
+       another testcase that install many (but not all) the auxiliary
+       scripts at once, and uses non-standard (but valid and documented)
+       setups (e.g., defining YACC in Makefile.am instead of calling
+       AC_PROG_YACC from configure.in).
+       * tests/copy.test: Reference `add-missing.test' in heading
+       comments.  Try few more test scenarios.
+
+2011-06-16  Stefano Lattarini  <address@hidden>
+
+       tests: few fixlets and improvements
+       * tests/cond31.test ($required): Remove `cc', it's not really
+       needed.
+       * tests/confh.test: Call autoheader too.  The lack of this call
+       wasn't causing spurious failures because the automatic remake
+       rules were somehow invoking it on our behalf (at make time).
+       * tests/fn99subdir.test: Use $subdirname throughout, instead of
+       ${subdirname}, for consistency with the rest of the testsuite.
+       Avoid an unnecessary subshell, which could also cause spurious
+       passes, being guarded by a trailing `|| Exit 1', which neutralize
+       the `errexit' flag.  Remove an unnecessary `|| Exit 1' guard.
+       * tests/insh2.test: Rewrite to avoid hackish Makefile.in munging,
+       and to also run configure and make.
+
+2011-06-13  Stefano Lattarini  <address@hidden>
+
        tests: don't hard-code test name in txinfo21.test
        * tests/txinfo21.test: Use `$me' instead of hard-coding the
        current testcase name "txinfo21".  Add a trailing `:' command
diff --git a/bootstrap b/bootstrap
index 95e51d1..aafc6eb 100755
--- a/bootstrap
+++ b/bootstrap
@@ -106,6 +106,7 @@ dosubst automake.in automake.tmp
 # Create required makefile snippets.
 cd tests
 $BOOTSTRAP_SHELL ./gen-parallel-tests > parallel-tests.am
+$BOOTSTRAP_SHELL ./gen-config-shell-tests > config-shell-tests.am
 $BOOTSTRAP_SHELL ./instspc-tests.sh --generate-makefile > instspc-tests.am
 $BOOTSTRAP_SHELL ./depmod-tests.sh --generate-makefile > depmod-tests.am
 cd ..
diff --git a/tests/.gitignore b/tests/.gitignore
index c309c22..a6d0cce 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -3,6 +3,7 @@ automake-*
 defs-static
 instspc-tests.am
 parallel-tests.am
+config-shell-tests.am
 depmod-tests.am
 *.dir
 *.log
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9b979d4..af3b291 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -93,28 +93,16 @@ $(depmod_tests:.depmod=.log): depmod-tests.sh 
depmod-data.log
 $(depmod_tests):
 
 
+include $(srcdir)/config-shell-tests.am
+
+$(srcdir)/config-shell-tests.am: gen-config-shell-tests Makefile.am
+       $(AM_V_GEN)($(am__cd) $(srcdir) && $(SHELL) ./gen-config-shell-tests) 
>$@
+EXTRA_DIST += gen-config-shell-tests
+
 TEST_EXTENSIONS += .shtst
 SHTST_LOG_COMPILER = $(SHELL) $(srcdir)/config-shell-tests.sh
 EXTRA_DIST += config-shell-tests.sh
 
-# FIXME: this list might probably be made auto-generated, like
-# $(parallel_tests) is...  But would that worth the hassle?
-config_shell_tests = \
-  ar-lib-w.shtst \
-  compile-w.shtst \
-  compile2-w.shtst \
-  compile3-w.shtst \
-  compile4-w.shtst \
-  compile5-w.shtst \
-  compile6-w.shtst \
-  instsh2-w.shtst \
-  instsh3-w.shtst \
-  mkinst3-w.shtst \
-  missing-w.shtst \
-  missing2-w.shtst \
-  missing3-w.shtst \
-  missing5-w.shtst
-
 # All `*-w.shtst' tests work by sourcing the script `config-shell-tests.sh'.
 $(config_shell_tests:.shtst=.log): config-shell-tests.sh
 # This dummy declaration is required to have make actually produce
@@ -134,6 +122,7 @@ AM_TESTS_ENVIRONMENT = \
   test x"$$me" = x || unset me; \
   test x"$$required" = x || unset required; \
   test x"$$parallel_tests" = x || unset parallel_tests; \
+  test x"$$test_prefer_config_shell" || unset test_prefer_config_shell; \
   test x"$$original_AUTOMAKE" = x || unset original_AUTOMAKE; \
   test x"$$original_ACLOCAL" = x || unset original_ACLOCAL; \
   AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC; \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 92daaf3..cdca4ff 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -50,7 +50,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/aclocal.in $(srcdir)/automake.in $(srcdir)/defs \
+       $(srcdir)/aclocal.in $(srcdir)/automake.in \
+       $(srcdir)/config-shell-tests.am $(srcdir)/defs \
        $(srcdir)/defs-static.in $(srcdir)/depmod-tests.am \
        $(srcdir)/instspc-tests.am $(srcdir)/parallel-tests.am \
        $(top_srcdir)/CheckListOfTests.am
@@ -306,8 +307,8 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 MAINTAINERCLEANFILES = 
 EXTRA_DIST = ChangeLog-old gen-parallel-tests parallel-tests.sh \
-       instspc-tests.sh depmod-tests.sh config-shell-tests.sh \
-       $(handwritten_tests)
+       instspc-tests.sh depmod-tests.sh gen-config-shell-tests \
+       config-shell-tests.sh $(handwritten_tests)
 TEST_EXTENSIONS = .test .ptest .instspc .depmod .shtst
 # Run the tests with the shell detected at configure time.
 TEST_LOG_COMPILER = $(SHELL)
@@ -386,27 +387,13 @@ depmod_tests = depcomp-gcc3.depmod depcomp-gcc.depmod \
        depcomp-cpp.depmod depcomp-msvisualcpp.depmod \
        depcomp-msvcmsys.depmod
 DEPMOD_LOG_COMPILER = $(SHELL) $(srcdir)/depmod-tests.sh
+config_shell_tests = ar-lib-w.shtst compile-w.shtst compile2-w.shtst \
+       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
 SHTST_LOG_COMPILER = $(SHELL) $(srcdir)/config-shell-tests.sh
 
-# FIXME: this list might probably be made auto-generated, like
-# $(parallel_tests) is...  But would that worth the hassle?
-config_shell_tests = \
-  ar-lib-w.shtst \
-  compile-w.shtst \
-  compile2-w.shtst \
-  compile3-w.shtst \
-  compile4-w.shtst \
-  compile5-w.shtst \
-  compile6-w.shtst \
-  instsh2-w.shtst \
-  instsh3-w.shtst \
-  mkinst3-w.shtst \
-  missing-w.shtst \
-  missing2-w.shtst \
-  missing3-w.shtst \
-  missing5-w.shtst
-
-
 # Some testsuite-influential variables should be overridable from the
 # test scripts, but not from the environment.
 # We want warning messages and explanations for skipped tests to go to
@@ -1394,7 +1381,7 @@ all: all-am
 
 .SUFFIXES:
 .SUFFIXES: .depmod .html .instspc .log .ptest .shtst .test
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/parallel-tests.am 
$(srcdir)/instspc-tests.am $(srcdir)/depmod-tests.am 
$(top_srcdir)/CheckListOfTests.am $(am__configure_deps)
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/parallel-tests.am 
$(srcdir)/instspc-tests.am $(srcdir)/depmod-tests.am 
$(srcdir)/config-shell-tests.am $(top_srcdir)/CheckListOfTests.am 
$(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
@@ -1784,6 +1771,25 @@ $(depmod_tests:.depmod=.log): depmod-tests.sh 
depmod-data.log
 # This dummy declaration is required to have make actually produce
 # expected log files from the `.depmod.log' suffix rule.
 $(depmod_tests):
+ar-lib-w.log: ar-lib.test
+compile-w.log: compile.test
+compile2-w.log: compile2.test
+compile3-w.log: compile3.test
+compile4-w.log: compile4.test
+compile5-w.log: compile5.test
+compile6-w.log: compile6.test
+instsh2-w.log: instsh2.test
+instsh3-w.log: instsh3.test
+mdate5-w.log: mdate5.test
+mdate6-w.log: mdate6.test
+missing-w.log: missing.test
+missing2-w.log: missing2.test
+missing3-w.log: missing3.test
+missing5-w.log: missing5.test
+mkinst3-w.log: mkinst3.test
+
+$(srcdir)/config-shell-tests.am: gen-config-shell-tests Makefile.am
+       $(AM_V_GEN)($(am__cd) $(srcdir) && $(SHELL) ./gen-config-shell-tests) 
>$@
 
 # All `*-w.shtst' tests work by sourcing the script `config-shell-tests.sh'.
 $(config_shell_tests:.shtst=.log): config-shell-tests.sh
diff --git a/tests/add-missing.test b/tests/add-missing.test
index f16da39..d6729f3 100755
--- a/tests/add-missing.test
+++ b/tests/add-missing.test
@@ -17,7 +17,7 @@
 # Test that automake complains when required auxiliary files are not
 # found, and that `automake --add-missing' installs the files (and only
 # the files) it's supposed to, and that these files are symlinked by
-# default, but copied if the `--install' option is used.
+# default, but copied if the `--copy' option is used.
 
 . ./defs || Exit 1
 
@@ -297,4 +297,25 @@ AM_PATH_PYTHON
 python_PYTHON = foo.py
 END
 
+: %%% few unrelated auxiliary scripts together %%%
+check_ <<'END'
+== Files ==
+py-compile
+depcomp
+ylwrap
+config.sub
+config.guess
+== configure.in ==
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_PROG_CXX
+== Makefile.am ==
+PYTHON = python
+pythondir = $(prefix)/py
+YACC = bison -y
+bin_PROGRAMS = foo
+foo_SOURCES = bar.yxx baz.c++
+python_PYTHON = zardoz.py
+END
+
 :
diff --git a/tests/cond31.test b/tests/cond31.test
index 5110ab1..b94820e 100755
--- a/tests/cond31.test
+++ b/tests/cond31.test
@@ -16,7 +16,6 @@
 
 # Make sure we define conditional _DEPENDENCIES correctly.
 
-required=cc
 . ./defs || Exit 1
 
 cat >>configure.in <<'EOF'
diff --git a/tests/confh.test b/tests/confh.test
index f900fd7..5b1c5a5 100755
--- a/tests/confh.test
+++ b/tests/confh.test
@@ -45,6 +45,7 @@ mkdir include
 
 $ACLOCAL
 $AUTOCONF
+$AUTOHEADER
 $AUTOMAKE
 
 ./configure
diff --git a/tests/copy.test b/tests/copy.test
index 714f722..3eb1c9e 100755
--- a/tests/copy.test
+++ b/tests/copy.test
@@ -16,16 +16,74 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test to make sure `-c' works.  Report from Andris Pavenis.
+# See also the much more in-depth test `add-missing'.
 
 . ./defs || Exit 1
 
+# First a simple test, where the auxdir is automatically determined
+# by automake.
+
 : > Makefile.am
 rm -f install-sh
 
 $ACLOCAL
 $AUTOMAKE -c -a
+ls -l # For debugging.
 
 test -f install-sh
 test ! -h install-sh
 
+# Let's do a couple of more elaborated tests, this time with the auxdir
+# explicitly defined in configure.in.
+
+mkdir sub
+cd sub
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([auxdir])
+AM_INIT_AUTOMAKE
+AC_PROG_CC
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<END
+bin_PROGRAMS = foo
+END
+
+$ACLOCAL
+
+# `automake -a' called without `-c' should create symlinks by default,
+# even when there is already a non-symlinked required auxiliary file.
+
+mkdir auxdir
+echo FAKE-DEPCOMP > auxdir/depcomp
+$AUTOMAKE -a
+ls -l auxdir # For debugging.
+test -f auxdir/install-sh
+test -h auxdir/install-sh
+test -f auxdir/depcomp
+test ! -h auxdir/depcomp
+test FAKE-DEPCOMP = `cat auxdir/depcomp`
+
+# `automake -a -c' should not create symlinks, even when there are
+# already symlinked required auxiliary files.
+
+rm -rf auxdir
+mkdir auxdir
+cd auxdir
+ln -s "$top_testsrcdir/lib/missing" "$top_testsrcdir/lib/install-sh" .
+cd ..
+
+$AUTOMAKE -a -c
+ls -l auxdir # For debugging.
+test -f auxdir/install-sh
+test -h auxdir/install-sh
+test -f auxdir/missing
+test -h auxdir/missing
+test -f auxdir/depcomp
+test ! -h auxdir/depcomp
+diff $top_testsrcdir/lib/depcomp auxdir/depcomp
+
 :
diff --git a/tests/fn99subdir.test b/tests/fn99subdir.test
index 3f793c8..add730f 100755
--- a/tests/fn99subdir.test
+++ b/tests/fn99subdir.test
@@ -23,50 +23,52 @@
 subdirname='cnfsubdir'
 
 cat >>configure.in <<END
-AC_CONFIG_SUBDIRS([${subdirname}])
+AC_CONFIG_SUBDIRS([$subdirname])
 AC_OUTPUT
 END
 
 cat >Makefile.am <<END
 AUTOMAKE_OPTIONS = filename-length-max=99
-SUBDIRS = ${subdirname}
+SUBDIRS = $subdirname
 END
 
-mkdir ${subdirname} || Exit 1
+mkdir $subdirname
 
-cat >> ${subdirname}/configure.in <<EOF
-AC_INIT([${subdirname}], [1.0])
+cat >> $subdirname/configure.in <<EOF
+AC_INIT([$subdirname], [1.0])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 EOF
 
-cat >${subdirname}/Makefile.am <<'END'
+cat >$subdirname/Makefile.am <<'END'
 AUTOMAKE_OPTIONS = filename-length-max=99
 EXTRA_DIST = 12345678
 END
 
-(cd ${subdirname} || Exit 1
+(cd $subdirname || Exit 1
 for i in 1 2 3 4 5 6 7 8; do
   mkdir -p 12345678 && cd 12345678 && touch x || Exit 1
 done) || skip_ "failed to create deep directory hierarchy"
 
 # AIX 5.3 `cp -R' is too buggy for `make dist'.
-cp -R ${subdirname} t \
+cp -R $subdirname t \
   || skip_ "'cp -R' failed to copy deep directory hierarchy"
 
-for init_dir in ${subdirname} .; do
-       (
-               cd ${init_dir} || Exit 1
-               $ACLOCAL
-               $AUTOCONF
-               $AUTOMAKE
-       ) || Exit 1
-done
+cd $subdirname
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+cd ..
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
 ./configure
 $MAKE distcheck
 
-(cd ${subdirname} || Exit 1
+(cd $subdirname || Exit 1
 for i in 1 2 3 4 5 6 7 8 9; do
   mkdir -p 12345678 && cd 12345678 && touch x || Exit 1
 done) || skip_ "failed to create deeper directory hierarchy"
diff --git a/tests/gen-config-shell-tests b/tests/gen-config-shell-tests
new file mode 100755
index 0000000..82477e3
--- /dev/null
+++ b/tests/gen-config-shell-tests
@@ -0,0 +1,70 @@
+#! /bin/sh
+# Generate config-shell-tests.am.
+#
+# 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/>.
+
+#
+# For each test in the $(handwritten_tests) list in this Makefile.am file,
+# that directly tests features of an automake-provided shell script from
+# the `lib/' subdirectory, define a sibling test that does likewise, but
+# using, to run said script, the configure-time $SHELL instead of the
+# default system shell /bin/sh.
+#
+# A test is considered a candidate for sibling-generation if it calls the
+# `get_shell_script' function anywhere.
+#
+# Individual tests can prevent the creation of such a sibling by explicitly
+# setting the `$test_prefer_config_shell' variable to either "yes" or "no".
+# The rationale for this is that if the variable is set to "yes", the test
+# already uses $SHELL, so that a sibling would be just a duplicate; while
+# if the variable is set to "no", the test doesn't support, or is not meant
+# to use, $SHELL to run the script under testing, and forcing it to do so
+# in the sibling would likely cause a spurious failure.
+#
+
+set -e
+
+tests=`sed -n '/^handwritten_tests =/,/^$/s/\(.*\.test\).*/\1/p' Makefile.am`
+
+if test -z "$tests"; then
+  echo "$0: failed to obtain list of tests" >&2
+  exit 1
+fi
+
+{
+  grep -l '^get_shell_script ' $tests
+  grep -l ' get_shell_script ' $tests
+} |
+LC_ALL=C sort -u |
+while read tst; do
+  grep "test_prefer_config_shell=" $tst >/dev/null || echo $tst
+done |
+sed -e 's/\.test$//' |
+{
+  echo "## Generated by gen-config-shell-tests."
+  echo "## Edit Makefile.am instead of this."
+  echo "config_shell_tests ="
+  # Since `foo-w.shtst' sources `foo.test', `foo-p.log' also depends on
+  # `foo.test'.
+  sed -e '
+    h
+    s/^/config_shell_tests += /
+    s/$/-w.shtst/
+    p
+    x
+    s/.*/&-w.log: &.test/
+  '
+}
diff --git a/tests/gen-parallel-tests b/tests/gen-parallel-tests
index 340b0e7..ed975fe 100755
--- a/tests/gen-parallel-tests
+++ b/tests/gen-parallel-tests
@@ -16,10 +16,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# For each test in the TESTS list in this Makefile.am file, that itself
-# tests features of the TESTS automake interface, define a sibling
-# test that does likewise, but with the option `parallel-tests' enabled.
-# Individual tests can prevent the creation of such a sibling by
+# For each test in the $(handwritten_tests) list in this Makefile.am file,
+# that itself tests features of the TESTS automake interface, define a
+# sibling test that does likewise, but with the option `parallel-tests'
+# enabled.  Individual tests can prevent the creation of such a sibling by
 # explicitly setting the `$parallel_tests' variable to either "yes" or
 # "no".  The rationale for this is that if the variable is set to "yes",
 # the test already uses the `parallel-tests' option, so that a sibling
diff --git a/tests/insh2.test b/tests/insh2.test
index e0a6bcd..11bde9b 100755
--- a/tests/insh2.test
+++ b/tests/insh2.test
@@ -19,16 +19,23 @@
 
 . ./defs || Exit 1
 
+echo AC_OUTPUT >> configure.in
+
 cat > Makefile.am << 'END'
 pkgdata_DATA =
-magic:
-       @echo $(DISTFILES)
+.PHONY: test
+test: distdir
+       find $(distdir) ;: For debugging.
+       echo ' ' $(DISTFILES) ' ' | grep '[ /]install-sh '
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]install-sh '
+       test -f $(distdir)/install-sh
 END
 
 $ACLOCAL
 $AUTOMAKE
+$AUTOCONF
 
-$FGREP -v @SET_MAKE@ Makefile.in > Makefile.sed
-$MAKE -s -f Makefile.sed SHELL=$SHELL magic | grep install-sh
+./configure
+$MAKE test
 
 :
diff --git a/tests/mdate5.test b/tests/mdate5.test
index dc6ede1..f7c7cfe 100755
--- a/tests/mdate5.test
+++ b/tests/mdate5.test
@@ -18,25 +18,28 @@
 # Test to make sure mdate-sh works correctly.
 
 . ./defs || Exit 1
-cat >> configure.in << 'END'
-AC_OUTPUT
-END
 
-cat > Makefile.am << 'END'
-info_TEXINFOS = textutils.texi
-END
+get_shell_script mdate-sh
 
-cat > textutils.texi << 'END'
address@hidden version.texi
address@hidden textutils.info
-END
-
-$ACLOCAL
-$AUTOMAKE --add-missing
-
-set x `$SHELL ./mdate-sh Makefile.am`
+set x `./mdate-sh install-sh`
 shift
+echo "$*" # For debugging.
+
 # Check that mdate output looks like a date:
 test $# = 3
 case $1$3 in *[!0-9]*) Exit 1;; esac
 test $1 -lt 32
+# Hopefully automake will be obsolete in 80 years ;-)
+case $3 in 20[0-9][0-9]) :;; *) Exit 1;; esac
+case $2 in
+  January|February|March|April|May|June|July|August) ;;
+  September|October|November|December) ;;
+  *) Exit 1
+esac
+
+# Stricter checks on the year required a POSIX date(1) command.
+if year=`date +%Y` && test $year -gt 2010; then
+  test $year = $3 || Exit 1
+fi
+
+:
diff --git a/tests/mdate6.test b/tests/mdate6.test
index 94ddb4d..70360e7 100755
--- a/tests/mdate6.test
+++ b/tests/mdate6.test
@@ -23,8 +23,9 @@ file='file  name $a'
 ( : > "$file" ) \
   || skip_ "file name with spaces and metacharacters not accepted"
 
-cp "$top_testsrcdir/lib/mdate-sh" .
-$SHELL ./mdate-sh "$file" >stdout 2>stderr ||
+get_shell_script mdate-sh
+
+./mdate-sh "$file" >stdout 2>stderr ||
   { cat stdout; cat stderr >&2; Exit 1; }
 cat stdout
 cat stderr >&2


hooks/post-receive
-- 
GNU Automake



reply via email to

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