automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-502-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11-502-gac2652e
Date: Sat, 11 Dec 2010 10:40:48 +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=ac2652e73581bc8b250e572e13137cf69a3a0968

The branch, master has been updated
       via  ac2652e73581bc8b250e572e13137cf69a3a0968 (commit)
       via  eee3f059062cec0e2c9fcafa8f4ad711ae959509 (commit)
       via  253c2e7e4afc90ca4b9077f9b85fbc0944133ef9 (commit)
       via  4abf2246375e96b8a82affdf04f079e3e9ee7c73 (commit)
       via  a46eda3752054eccd208f630611fefe0308eafc1 (commit)
      from  b205636eebe09a462c7393c691ddc0a53ebd14d1 (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 ac2652e73581bc8b250e572e13137cf69a3a0968
Merge: eee3f05 a46eda3
Author: Stefano Lattarini <address@hidden>
Date:   Fri Dec 10 22:26:47 2010 +0100

    Merge branch 'tests-colon-extend'

commit eee3f059062cec0e2c9fcafa8f4ad711ae959509
Merge: b205636 253c2e7
Author: Stefano Lattarini <address@hidden>
Date:   Fri Dec 10 22:26:03 2010 +0100

    Merge branch 'tests-dejagnu-extend'

commit 253c2e7e4afc90ca4b9077f9b85fbc0944133ef9
Author: Stefano Lattarini <address@hidden>
Date:   Sat Oct 16 17:03:03 2010 +0200

    Extend and improve tests on DejaGnu support.
    
    * tests/dejagnu.test: Do not create useless dummy test script.
    Add trailing `:' command.  In heading comments, add reference
    to ...
    * tests/check12.test: ... this new "semantic" test, covering
    concurrent use of dejagnu tests, simple tests and `check-local'
    target.
    * tests/dejagnu2.test: Make test more reliable, by avoid weak
    grepping of make output.  Prefer `cat' over `echo' to append
    to configure.in.  Quote literal dots in grep regexps.  Prefer
    `grep -c ...' over `grep ... | wc -l'.  Make grepping of
    automake stderr slightly stricter.  Add trailing `:' command.
    * tests/dejagnu3.test: Prefer `cat' over `echo' to append to
    configure.in.  Check stderr of expected-to-fail "make" call.
    Remove extra blank lines from Makefile.am.
    * tests/dejagnu4.test: Prefer `cat' over `echo' to append to
    configure.in.  Prefer `mv -f' over plain `mv' when the target
    file already exists.  Avoid extra mkdir calls by creating more
    directories at once.  Better use of blank lines.  Check that
    the `*.log' and `*.sum' files are created by runtest also when
    "make check" fails.
    * tests/dejagnu7.test: Prefer `cat' over `echo' to append to
    configure.in.  Better use of blank lines.  Add a trailing `:'
    command.
    * tests/dejagnu6.test: Likewise, and give the dejagnu test a
    more descriptive name.
    * tests/dejagnu5.test: Likewise.  Also, simply define package
    name to `$me' rather than using a non-obvious sed script to
    extract it from `AC_INIT', and write the Makefile.am with only
    one command.
    * tests/Makefile.am (TESTS): Updated.

commit a46eda3752054eccd208f630611fefe0308eafc1
Author: Stefano Lattarini <address@hidden>
Date:   Wed Nov 17 00:40:42 2010 +0100

    Make tests `colon*.test' more "semantic".
    
    Prefer running configure and make over grepping the generated
    files; this is both more correct and less fragile.
    * tests/colon.test: Made more "semantic", as described above.
    * tests/colon5.test: Likewise.
    * tests/colon6.test: Likewise.
    * tests/colon7.test: Likewise.
    * tests/colon2.test: Likewise, and improve syncing with sister
    test `colon3.test'.
    * tests/colon3.test: Likewise (but with the sister test being
    `colon2.test' here).

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

Summary of changes:
 ChangeLog           |   55 ++++++++++++++
 tests/Makefile.am   |    1 +
 tests/Makefile.in   |   12 ++-
 tests/check12.test  |  205 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/colon.test    |   15 ++++-
 tests/colon2.test   |   49 +++++++++++-
 tests/colon3.test   |   59 ++++++++++++---
 tests/colon5.test   |   43 ++++++++---
 tests/colon6.test   |   71 +++++++++++++++---
 tests/colon7.test   |   25 ++++--
 tests/dejagnu.test  |    7 +-
 tests/dejagnu2.test |   21 +++--
 tests/dejagnu3.test |   17 +++--
 tests/dejagnu4.test |   19 +++--
 tests/dejagnu5.test |   19 ++---
 tests/dejagnu6.test |   16 ++--
 tests/dejagnu7.test |   10 +-
 tests/subobj9.test  |    3 +
 18 files changed, 544 insertions(+), 103 deletions(-)
 create mode 100755 tests/check12.test

diff --git a/ChangeLog b/ChangeLog
index beb5848..20da64d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,58 @@
+2010-12-07  Stefano Lattarini  <address@hidden>
+
+       Make tests `colon*.test' more "semantic".
+       Prefer running configure and make over grepping the generated
+       files; this is both more correct and less fragile.
+       * tests/colon.test: Made more "semantic", as described above.
+       * tests/colon5.test: Likewise.
+       * tests/colon6.test: Likewise.
+       * tests/colon7.test: Likewise.
+       * tests/colon2.test: Likewise, and improve syncing with sister
+       test `colon3.test'.
+       * tests/colon3.test: Likewise (but with the sister test being
+       `colon2.test' here).
+
+2010-12-10  Stefano Lattarini  <address@hidden>
+
+       Extend and improve tests on DejaGnu support.
+       * tests/dejagnu.test: Do not create useless dummy test script.
+       Add trailing `:' command.  In heading comments, add reference
+       to ...
+       * tests/check12.test: ... this new "semantic" test, covering
+       concurrent use of dejagnu tests, simple tests and `check-local'
+       target.
+       * tests/dejagnu2.test: Make test more reliable, by avoid weak
+       grepping of make output.  Prefer `cat' over `echo' to append
+       to configure.in.  Quote literal dots in grep regexps.  Prefer
+       `grep -c ...' over `grep ... | wc -l'.  Make grepping of
+       automake stderr slightly stricter.  Add trailing `:' command.
+       * tests/dejagnu3.test: Prefer `cat' over `echo' to append to
+       configure.in.  Check stderr of expected-to-fail "make" call.
+       Remove extra blank lines from Makefile.am.
+       * tests/dejagnu4.test: Prefer `cat' over `echo' to append to
+       configure.in.  Prefer `mv -f' over plain `mv' when the target
+       file already exists.  Avoid extra mkdir calls by creating more
+       directories at once.  Better use of blank lines.  Check that
+       the `*.log' and `*.sum' files are created by runtest also when
+       "make check" fails.
+       * tests/dejagnu7.test: Prefer `cat' over `echo' to append to
+       configure.in.  Better use of blank lines.  Add a trailing `:'
+       command.
+       * tests/dejagnu6.test: Likewise, and give the dejagnu test a
+       more descriptive name.
+       * tests/dejagnu5.test: Likewise.  Also, simply define package
+       name to `$me' rather than using a non-obvious sed script to
+       extract it from `AC_INIT', and write the Makefile.am with only
+       one command.
+       * tests/Makefile.am (TESTS): Updated.
+
+2010-12-10  Ralf Wildenhues  <address@hidden>
+
+       Avoid running installed automake from 'libtool --help'.
+       * tests/subobj9.test: Export AUTOCONF and AUTOMAKE.
+       Together with fixed Libtool, this fixes check-coverage to not
+       invoke installed automake.
+
 2010-12-06  Stefano Lattarini  <address@hidden>
 
        Separate checks on target overriding into multiple test scripts.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 43a2a7f..b8e9b1d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -199,6 +199,7 @@ check8.test \
 check9.test \
 check10.test \
 check11.test \
+check12.test \
 checkall.test \
 clean.test \
 clean2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 154e120..55d1446 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -288,11 +288,11 @@ XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test 
\
        override-conditional-2.test txinfo5.test \
        $(instspc_xfail_tests)
 parallel_tests = backcompat5-p.test check-p.test check10-p.test \
-       check11-p.test check2-p.test check3-p.test check4-p.test \
-       check5-p.test check6-p.test check7-p.test check8-p.test \
-       check9-p.test color-p.test color2-p.test comment9-p.test \
-       dejagnu-p.test exeext4-p.test maken3-p.test maken4-p.test \
-       pr401-p.test pr401b-p.test pr401c-p.test
+       check11-p.test check12-p.test check2-p.test check3-p.test \
+       check4-p.test check5-p.test check6-p.test check7-p.test \
+       check8-p.test check9-p.test color-p.test color2-p.test \
+       comment9-p.test dejagnu-p.test exeext4-p.test maken3-p.test \
+       maken4-p.test pr401-p.test pr401b-p.test pr401c-p.test
 instspc_tests = instspc-squote-build.test instspc-squote-install.test \
        instspc-dquote-build.test instspc-dquote-install.test \
        instspc-bquote-build.test instspc-bquote-install.test \
@@ -461,6 +461,7 @@ check8.test \
 check9.test \
 check10.test \
 check11.test \
+check12.test \
 checkall.test \
 clean.test \
 clean2.test \
@@ -1487,6 +1488,7 @@ backcompat5-p.log: backcompat5.test
 check-p.log: check.test
 check10-p.log: check10.test
 check11-p.log: check11.test
+check12-p.log: check12.test
 check2-p.log: check2.test
 check3-p.log: check3.test
 check4-p.log: check4.test
diff --git a/tests/check12.test b/tests/check12.test
new file mode 100755
index 0000000..caa8e0f
--- /dev/null
+++ b/tests/check12.test
@@ -0,0 +1,205 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test to make sure dejagnu tests, automake-style tests, and check-local
+# target can coexist.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS =
+EXTRA_DIST =
+CLEANFILES =
+END
+
+## Simple tests.
+
+cat > a.test << 'END'
+#!/bin/sh
+exit ${A_EXIT_STATUS-0}
+END
+cat > b.test << 'END'
+#!/bin/sh
+exit ${B_EXIT_STATUS-0}
+END
+chmod +x a.test b.test
+
+cat >> Makefile.am << 'END'
+TESTS = a.test b.test
+EXTRA_DIST += $(TESTS)
+END
+
+A_EXIT_STATUS=0; export A_EXIT_STATUS
+B_EXIT_STATUS=0; export B_EXIT_STATUS
+
+## DejaGnu tests.
+
+cat >> Makefile.am << 'END'
+AUTOMAKE_OPTIONS += dejagnu
+DEJATOOL = hammer spanner
+AM_RUNTESTFLAGS = HAMMER=$(srcdir)/hammer SPANNER=$(srcdir)/spanner
+EXTRA_DIST += hammer.test/hammer.exp
+EXTRA_DIST += spanner.test/spanner.exp
+END
+
+cat > hammer << 'END'
+#! /bin/sh
+echo "Everything looks like a ${NAIL-nail} to me!"
+END
+
+NAIL=nail; export NAIL
+
+cat > spanner << 'END'
+#! /bin/sh
+echo "I'm a right spanner!"
+END
+chmod +x hammer spanner
+
+mkdir hammer.test spanner.test
+
+cat > hammer.test/hammer.exp << 'END'
+set test test_hammer
+spawn $HAMMER
+expect {
+    "Everything looks like a nail to me!" { pass "$test" }
+    default { fail "$test" }
+}
+END
+
+cat > spanner.test/spanner.exp << 'END'
+set test test_spanner
+spawn $SPANNER
+expect {
+    "I'm a right spanner!" { pass "$test" }
+    default { fail "$test" }
+}
+END
+
+## User-defined extra tests.
+
+cat >> Makefile.am <<'END'
+check-local:
+       case $$CHECKLOCAL_EXIT_STATUS in \
+         0) echo 'check-local succeded :-)';; \
+         *) echo 'check-local failed :-(';; \
+       esac >local.log
+       exit $$CHECKLOCAL_EXIT_STATUS
+CLEANFILES += local.log
+END
+CHECKLOCAL_EXIT_STATUS=0; export CHECKLOCAL_EXIT_STATUS
+
+## Go with the testcase execution.
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+for vpath in : false; do
+
+  if $vpath; then
+    srcdir=..
+    mkdir build_
+    cd build_
+  else
+    srcdir=.
+  fi
+
+  if test -f config.status; then
+    $MAKE distclean
+  fi
+
+  $srcdir/configure
+
+  $MAKE check
+  test -f hammer.log
+  test -f hammer.sum
+  test -f spanner.log
+  test -f spanner.sum
+  # This checks will be run only by the autogenerated `check12-p.test'.
+  if test x"$parallel_tests" = x"yes"; then
+    cat test-suite.log
+    grep '^PASS: a\.test (exit: 0)' a.log
+    grep '^PASS: b\.test (exit: 0)' b.log
+  else
+    :
+  fi
+  grep 'check-local succeded :-)' local.log
+
+  cp -f config.status config-status.sav
+
+  $MAKE distclean
+  test ! -r hammer.log
+  test ! -r hammer.sum
+  test ! -r spanner.log
+  test ! -r spanner.sum
+  test ! -r test-suite.log
+  test ! -r a.log
+  test ! -r b.log
+  test ! -r local.log
+
+  mv -f config-status.sav config.status
+  ./config.status
+
+  NAIL=screw $MAKE check && Exit 1
+  test -f hammer.log
+  test -f hammer.sum
+  test -f spanner.log
+  test -f spanner.sum
+  grep 'FAIL: test_hammer' hammer.sum
+  grep 'FAIL:' spanner.sum && Exit 1
+
+  B_EXIT_STATUS=1 $MAKE check && Exit 1
+  # This checks will be run only by the autogenerated `check12-p.test'.
+  if test x"$parallel_tests" = x"yes"; then
+    cat test-suite.log
+    grep '^PASS: a\.test (exit: 0)' a.log
+    grep '^FAIL: b\.test (exit: 1)' b.log
+    grep '^FAIL: b\.test (exit: 1)' test-suite.log
+  else :; fi
+
+  CHECKLOCAL_EXIT_STATUS=1 $MAKE check && Exit 1
+  grep 'check-local failed :-(' local.log
+
+  # Do not trust the exit status of `make -k'.
+  NAIL=screw B_EXIT_STATUS=23 CHECKLOCAL_EXIT_STATUS=1 $MAKE -k check || :
+  test -f hammer.log
+  test -f hammer.sum
+  test -f spanner.log
+  test -f spanner.sum
+  grep 'FAIL: test_hammer' hammer.sum
+  grep 'FAIL:' spanner.sum && Exit 1
+  # This checks will be run only by the autogenerated `check12-p.test'.
+  if test x"$parallel_tests" = x"yes"; then
+    cat test-suite.log
+    grep '^PASS: a\.test (exit: 0)' a.log
+    grep '^FAIL: b\.test (exit: 23)' b.log
+    grep '^FAIL: b\.test (exit: 23)' test-suite.log
+  else :; fi
+  grep 'check-local failed :-(' local.log
+
+  cd $srcdir
+
+done
+
+$MAKE distcheck
+
+:
diff --git a/tests/colon.test b/tests/colon.test
index 22b5ed3..f1eec9a 100755
--- a/tests/colon.test
+++ b/tests/colon.test
@@ -27,10 +27,23 @@ AC_CONFIG_FILES([foo.h:foo.hin])
 AC_OUTPUT
 END
 
-: > Makefile.am
 : > foo.hin
 
+cat > Makefile.am <<'END'
+.PHONY: test
+test: distdir
+       ls -l . $(distdir)
+       test -f foo.h
+       test -f $(distdir)/foo.hin
+END
+
 $ACLOCAL
 $AUTOMAKE
+$AUTOCONF
+
+./configure
+
+$MAKE test
+$MAKE distcheck
 
 :
diff --git a/tests/colon2.test b/tests/colon2.test
index a52dfa8..503f6db 100755
--- a/tests/colon2.test
+++ b/tests/colon2.test
@@ -16,6 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure ":" works with files automake generates.
+# See also sister test `colon3.test'.
 
 . ./defs || Exit 1
 
@@ -28,14 +29,54 @@ AC_CONFIG_FILES([Makefile:zardoz.in])
 AC_OUTPUT
 END
 
-echo 'dummy:' > zardoz.am
+cat > zardoz.am <<END
+.PHONY: dummy
+dummy:
+END
 
 $ACLOCAL
 $AUTOMAKE
 
-# We actually check several things here.
+# Automake should have created zardoz.in.
 test -f zardoz.in
-grep '^zardoz:' zardoz.in && Exit 1
-grep '^dummy:' zardoz.in
+
+# The generated file should refer to zardoz.in and zardoz.am, but
+# never just "zardoz".
+$FGREP 'zardoz.am' zardoz.in
+$FGREP 'zardoz.in' zardoz.in
+sed -e 's|zardoz\.am|zrdz.am|g' \
+    -e 's|zardoz\.in|zrdz.in|g' \
+  <zardoz.in | $FGREP 'zardoz' && Exit 1
+
+# The configure-generated Makefile should depend on zardoz.in, two.in and
+# three.in.  The automake-generated zardoz.in should depend on zardoz.am.
+# Let's do this check the right way by running configure and make.
+
+str='%% ZaR DoZ %%'
+
+$AUTOCONF
+./configure
+test -f Makefile # sanity check
+
+$MAKE dummy
+# Again, make sure that the generated Makefile do not unduly
+# refer to `zardoz' .
+$MAKE -n zardoz && Exit 1
+
+$sleep
+cat >> zardoz.am <<END
+check-local: testam testin testmk
+.PHONY: testam testin testmk
+testam:
+       grep '$str' \$(srcdir)/zardoz.am
+testin:
+       grep '$str' \$(srcdir)/zardoz.in
+testmk:
+       grep '$str' Makefile
+END
+$MAKE Makefile # for non-GNU make
+$MAKE testam testin testmk
+
+$MAKE distcheck
 
 :
diff --git a/tests/colon3.test b/tests/colon3.test
index 151d015..e261b72 100755
--- a/tests/colon3.test
+++ b/tests/colon3.test
@@ -17,6 +17,7 @@
 
 # Make sure ":" works with files automake generates.
 # This test is for multiple ":"s.
+# See also sister test `colon2.test'.
 
 . ./defs || Exit 1
 
@@ -29,7 +30,11 @@ AC_CONFIG_FILES([Makefile:zardoz.in:two.in:three.in])
 AC_OUTPUT
 END
 
-: > zardoz.am
+cat > zardoz.am <<END
+.PHONY: dummy
+dummy:
+END
+
 : > two.in
 : > three.in
 
@@ -41,21 +46,49 @@ test -f zardoz.in
 
 # The generated file should refer to zardoz.in and zardoz.am, but
 # never just "zardoz".
+$FGREP 'zardoz.am' zardoz.in
+$FGREP 'zardoz.in' zardoz.in
 sed -e 's|zardoz\.am|zrdz.am|g' \
     -e 's|zardoz\.in|zrdz.in|g' \
   <zardoz.in | $FGREP 'zardoz' && Exit 1
 
-# FIXME: Do something like this after planned enahncements to tests/defs.
-# FIXME: Or even do proper functional testing.
-## Also, Makefile should depend on two.in and three.in.
-# extract_makefile_deps Makefile zardoz.in > deps
-#$FGREP ' $(srcdir)/two.in ' deps
-#$FGREP ' $(srcdir)/three.in ' deps
-#
-# FIXME: for the moment, we content ourselves with these inferior tests.
-# Makefile should depend on two.in.
-grep '^Makefile:.* \$(srcdir)/two.in' zardoz.in
-# Likewise three.in.
-grep '^Makefile:.* \$(srcdir)/three.in' zardoz.in
+# The configure-generated Makefile should depend on zardoz.in, two.in and
+# three.in.  The automake-generated zardoz.in should depend on zardoz.am.
+# Let's do this check the right way by running configure and make.
+
+str='%% ZaR DoZ %%'
+str2='// 2_TwO_2 //'
+str3='== @thr33@ =='
+
+$AUTOCONF
+./configure
+test -f Makefile # sanity check
+
+$MAKE dummy
+# Again, make sure that the generated Makefile do not unduly
+# refer to `zardoz' .
+$MAKE -n zardoz && Exit 1
+
+$sleep
+cat >> zardoz.am <<END
+check-local: testam testin testmk test2 test3
+.PHONY: testam testin test2 testmk test3
+testam:
+       grep '$str' \$(srcdir)/zardoz.am
+testin:
+       grep '$str' \$(srcdir)/zardoz.in
+testmk:
+       grep '$str' Makefile
+test2:
+       grep '$str2' \$(srcdir)/two.in
+test3:
+       grep '$str3' \$(srcdir)/three.in
+END
+echo "# $str2" >> two.in
+echo "# $str3" >> three.in
+$MAKE Makefile # for non-GNU make
+$MAKE testam testin testmk test2 test3
+
+$MAKE distcheck
 
 :
diff --git a/tests/colon5.test b/tests/colon5.test
index 9dae9c8..2db2484 100755
--- a/tests/colon5.test
+++ b/tests/colon5.test
@@ -31,21 +31,44 @@ END
 : > Makefile.dep
 
 cat > Makefile.am <<'END'
-.PHONY: test
-test:
-       case ' $(DIST_COMMON) ' in \
-         *' $(srcdir)/Makefile.dep '*|*' Makefile.dep '*) exit 0;; \
-         *) exit 1;; \
-       esac
+.PHONY: test-fs-layout test-grep test-distcommon test-distdir
+check-local: test-fs-layout test-grep test-distcommon test-distdir
+test-fs-layout:
+       test x'$(srcdir)' = '.' || test ! -r Makefile.dep
+test-grep:
+## The use of $(empty) prevents spurious matches.
+       grep '=GrEp$(empty)Me_am=' $(srcdir)/Makefile.in
+       grep '=GrEp$(empty)Me_dep=' $(srcdir)/Makefile.dep
+       grep '=GrEp$(empty)Me_am=' Makefile
+       grep '=GrEp$(empty)Me_dep=' Makefile
+test-distcommon:
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]Makefile.dep '
+test-distdir: distdir
+       test -f $(distdir)/Makefile.dep
 END
 
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE
 
-grep 'Makefile:Makefile\.in' Makefile.in
-grep '^Makefile:.* \$(srcdir)/Makefile\.dep' Makefile.in
+./configure
 
-sed -e '/@SET_MAKE@/d' -e "address@hidden@!$SHELL!g" <Makefile.in >Makefile.sed
-$MAKE -f Makefile.sed SHELL=$SHELL test
+grep '=GrEpMe_am=' Makefile && Exit 1   # sanity check
+grep '=GrEpMe_dep=' Makefile && Exit 1  # likewise
+
+$MAKE test-distcommon
+$MAKE test-distdir
+
+$sleep
+
+echo '# =GrEpMe_am=' >> Makefile.am
+echo '# =GrEpMe_dep=' >> Makefile.dep
+
+$MAKE Makefile # for non-GNU make
+$MAKE test-grep
+$MAKE test-distcommon
+$MAKE test-distdir
+
+$MAKE distcheck
 
 :
diff --git a/tests/colon6.test b/tests/colon6.test
index 7c620d6..71ee4bd 100755
--- a/tests/colon6.test
+++ b/tests/colon6.test
@@ -24,30 +24,77 @@ set -e
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
+# With this, version.good should depend from version.gin, while
+# Makefile should not depend from either of them.
 AC_CONFIG_FILES([demo/Makefile demo/version.good:demo/version.gin])
 AC_OUTPUT
 END
 
 mkdir demo
-
 : > demo/version.gin
-
-cat > demo/Makefile.am <<'END'
-.PHONY: test
-test:
-       case ' $(DIST_COMMON) ' in \
-         *' $(srcdir)/version.gin '*) exit 0;; \
-         *) exit 1;; \
-       esac
-END
+: > demo/Makefile.am
 
 $ACLOCAL
 $AUTOMAKE
 
+# These are older "grepping check", kept mostly for backward-copmatibility.
+# They might (unlikely, but possibly) require updating when automake
+# internals are changed.  Just relax or remove if they become too fragile.
 $EGREP 'Makefile:.*(demo|version)' demo/Makefile.in && Exit 1
 grep 'version\.good:.*version\.gin' demo/Makefile.in
 
-sed -e '/@SET_MAKE@/d' -e "address@hidden@!$SHELL!g" <demo/Makefile.in 
>Makefile.sed
-$MAKE -f Makefile.sed SHELL=$SHELL test
+$AUTOCONF
+
+for vpath in : false; do
+
+  if $vpath; then
+    srcdir=..
+    mkdir build
+    cd build
+  else
+    srcdir=.
+  fi
+
+  $srcdir/configure
+
+  test -f demo/version.good    # sanity check
+  test ! -s demo/version.good  # likewise
+
+  cd demo
+
+  # version.good should depend from version.gin
+  $sleep
+  echo "Rebuilt (srcdir=$srcdir)" > ../$srcdir/demo/version.gin
+  $MAKE version.good
+  $FGREP "Rebuilt (srcdir=$srcdir)" version.good
+
+  # Makefile should not depend from version.good.
+  rm -f version.good
+  $MAKE Makefile
+  test ! -r version.good
+
+  # version.good should be rebuilt from version.gin
+  $MAKE version.good
+  test -f version.good
+
+  # Makefile should not depend from version.gin.
+  rm -f ../$srcdir/demo/version.gin
+  $MAKE Makefile
+  test ! -r ../$srcdir/demo/version.gin # sanity check
+
+  # version.good should depend from version.gin
+  rm -f version.good
+  $MAKE version.good >output 2>&1 && { cat output; Exit 1; }
+  cat output
+  # Try to verify that we errored out for the right reason.
+  $FGREP version.gin output
+
+  cd .. # back in top builddir
+  cd $srcdir
+
+  # Re-create it for the next pass (if any).
+  : > demo/version.gin
+
+done
 
 :
diff --git a/tests/colon7.test b/tests/colon7.test
index 4195188..40bd0a6 100755
--- a/tests/colon7.test
+++ b/tests/colon7.test
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Another test for a failing ":" in AC_OUTPUT.  Report from Maciej
-# Stachowiak.
+# Another test for a failing ":" in AC_OUTPUT.
+# Report from Maciej Stachowiak.
 
 . ./defs || Exit 1
 
@@ -32,19 +32,26 @@ AC_OUTPUT(subdir/bar:subdir/foo \
 )
 END
 
-: > Makefile.am
-
 mkdir subdir
-: > subdir/Makefile.am
+: > Makefile.am
 : > subdir/foo
+cat > subdir/Makefile.am << 'END'
+.PHONY: test
+test:
+       ## DIST_COMMON should contain `foo', not `subdir/foo'.
+       case '$(DIST_COMMON)' in *subdir/foo*) exit 1;; *) exit 0;; esac
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]foo '
+END
 
 $ACLOCAL
 $AUTOMAKE
 
-# shouldn't have any bar.in
-grep 'bar.in' subdir/Makefile.in && Exit 1
+# Should nowhere refer to `bar.in'.
+$FGREP 'bar.in' Makefile.in subdir/Makefile.in && Exit 1
 
-# DIST_COMMON should have foo, not subdir/foo
-grep 'DIST_COMMON.*subdir/foo' subdir/Makefile.in && Exit 1
+$AUTOCONF
+./configure
+cd subdir
+$MAKE test
 
 :
diff --git a/tests/dejagnu.test b/tests/dejagnu.test
index a273770..b3e58e7 100755
--- a/tests/dejagnu.test
+++ b/tests/dejagnu.test
@@ -14,7 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure dejagnu tests and automake-style tests can coexist.
+# Superficial test to check that dejagnu tests and automake-style
+# tests can coexist.  See also related deeper test `check12.test'.
 
 . ./defs || Exit 1
 
@@ -25,10 +26,10 @@ AUTOMAKE_OPTIONS = dejagnu
 TESTS = frob.test
 END
 
-: > frob.test
-
 $ACLOCAL
 $AUTOMAKE
 
 grep '^check-TESTS' Makefile.in
 grep '^check-DEJAGNU' Makefile.in
+
+:
diff --git a/tests/dejagnu2.test b/tests/dejagnu2.test
index 531f744..121f6d8 100755
--- a/tests/dejagnu2.test
+++ b/tests/dejagnu2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2010 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
@@ -20,26 +20,29 @@
 
 set -e
 
-echo 'AC_OUTPUT' >> configure.in
+cat >> configure.in <<'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
 
 site.exp:
-       @echo foo
+       echo :GREP:ME: > $@
 END
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -Wno-override
 
-grep site.exp Makefile.in
-test `grep '^site\.exp:' Makefile.in | wc -l` -eq 1
+grep 'site\.exp' Makefile.in
+test `grep -c '^site\.exp:' Makefile.in` -eq 1
 
 ./configure
-$MAKE site.exp >stdout
-cat stdout
-grep foo stdout
+$MAKE site.exp
+grep ':GREP:ME:' site.exp
 
 AUTOMAKE_fails
-grep 'Makefile.am:3:.*site.exp' stderr
+grep '^Makefile\.am:3:.*site\.exp' stderr
+
+:
diff --git a/tests/dejagnu3.test b/tests/dejagnu3.test
index d812ac4..2c5d375 100755
--- a/tests/dejagnu3.test
+++ b/tests/dejagnu3.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2010 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
@@ -28,15 +28,14 @@ END
 
 chmod +x hammer
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
-
 DEJATOOL = hammer
-
 AM_RUNTESTFLAGS = HAMMER=$(srcdir)/hammer
-
 EXTRA_DIST = hammer hammer.test/hammer.exp
 END
 
@@ -65,5 +64,9 @@ $MAKE distcheck
 
 # Ensure that the envvar RUNTESTFLAGS is used.
 # Report from Mark Mitchell.
-RUNTESTFLAGS=--unknown-option $MAKE check && Exit 1
-Exit 0
+RUNTESTFLAGS=--unknown-runtest-option $MAKE check >output 2>&1 \
+  && { cat output; Exit 1; }
+cat output
+$FGREP 'unknown-runtest-option' output
+
+:
diff --git a/tests/dejagnu4.test b/tests/dejagnu4.test
index 5fdda10..fa64a31 100755
--- a/tests/dejagnu4.test
+++ b/tests/dejagnu4.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2006  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2010 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
@@ -26,17 +26,17 @@ cat > hammer << 'END'
 #! /bin/sh
 echo "Everything looks like a nail to me!"
 END
-
 chmod +x hammer
 
 cat > spanner << 'END'
 #! /bin/sh
 echo "I'm a right spanner!"
 END
-
 chmod +x spanner
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
@@ -49,8 +49,7 @@ EXTRA_DIST  = hammer  hammer.test/hammer.exp
 EXTRA_DIST += spanner spanner.test/spanner.exp
 END
 
-mkdir hammer.test
-mkdir spanner.test
+mkdir hammer.test spanner.test
 
 cat > hammer.test/hammer.exp << 'END'
 set test test
@@ -86,8 +85,14 @@ $MAKE distcheck
 
 # Test for PR 488.
 sed 's/E\(verything\)/Not e\1/' hammer > thammer
-mv thammer hammer
+mv -f thammer hammer
 chmod +x hammer
 
+rm -f hammer.log hammer.sum spanner.log spanner.sum
 $MAKE check && Exit 1
+test -f hammer.log
+test -f hammer.sum
+test -f spanner.log
+test -f spanner.sum
+
 :
diff --git a/tests/dejagnu5.test b/tests/dejagnu5.test
index 0095958..0237a08 100755
--- a/tests/dejagnu5.test
+++ b/tests/dejagnu5.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2010 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
@@ -22,30 +22,27 @@ required=runtest
 
 set -e
 
-# Get the package name from configure.in.
-package=`$FGREP AC_INIT configure.in | sed -e 's:^[^[]*\[\([^]]*\)\].*$:\1:'`
+package=$me
 
 cat > $package << 'END'
 #! /bin/sh
 echo "Ah, we have been expecting you, Mr. Blond."
 END
-
 chmod +x $package
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << END
 AUTOMAKE_OPTIONS = dejagnu
-
 EXTRA_DIST = $package $package.test/$package.exp
+AM_RUNTESTFLAGS = PACKAGE=\$(srcdir)/$package
 END
 
-echo "AM_RUNTESTFLAGS = PACKAGE=\$(srcdir)/$package" >> Makefile.am
-
 mkdir $package.test
-
 cat > $package.test/$package.exp << 'END'
-set test "test"
+set test "a_dejagnu_test"
 spawn $PACKAGE
 expect {
     "Ah, we have been expecting you, Mr. Blond." { pass "$test" }
@@ -64,3 +61,5 @@ test -f $package.log
 test -f $package.sum
 
 $MAKE distcheck
+
+:
diff --git a/tests/dejagnu6.test b/tests/dejagnu6.test
index 25a1f1f..662ca28 100755
--- a/tests/dejagnu6.test
+++ b/tests/dejagnu6.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 2010 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
@@ -25,23 +25,21 @@ cat > faildeja << 'END'
 #! /bin/sh
 echo whatever
 END
-
 chmod +x faildeja
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
-
 DEJATOOL = faildeja
-
 AM_RUNTESTFLAGS = FAILDEJA=$(srcdir)/faildeja
 END
 
 mkdir faildeja.test
-
 cat > faildeja.test/faildeja.exp << 'END'
-set test test
+set test failing_deja_test
 spawn $FAILDEJA
 expect {
     default { fail "$test" }
@@ -57,4 +55,6 @@ $AUTOMAKE --add-missing
 $MAKE check && Exit 1
 test -f faildeja.log
 test -f faildeja.sum
-$FGREP 'FAIL: test' faildeja.sum
+$FGREP 'FAIL: failing_deja_test' faildeja.sum
+
+:
diff --git a/tests/dejagnu7.test b/tests/dejagnu7.test
index 552c2ca..0be4d1f 100755
--- a/tests/dejagnu7.test
+++ b/tests/dejagnu7.test
@@ -29,21 +29,19 @@ cat > failtcl << 'END'
 #! /bin/sh
 echo whatever
 END
-
 chmod +x failtcl
 
-echo AC_OUTPUT >> configure.in
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
 
 cat > Makefile.am << 'END'
 AUTOMAKE_OPTIONS = dejagnu
-
 DEJATOOL = failtcl
-
 AM_RUNTESTFLAGS = --status FAILTCL=$(srcdir)/failtcl
 END
 
 mkdir failtcl.test
-
 cat > failtcl.test/failtcl.exp << 'END'
 set test test
 spawn $FAILTCL
@@ -62,3 +60,5 @@ $MAKE check && Exit 1
 test -f failtcl.log
 test -f failtcl.sum
 $FGREP 'missing close-brace' failtcl.sum
+
+:
diff --git a/tests/subobj9.test b/tests/subobj9.test
index 2045d58..83f3a31 100755
--- a/tests/subobj9.test
+++ b/tests/subobj9.test
@@ -64,6 +64,9 @@ $AUTOMAKE -a
 # Skip this test on configure errors (e.g., broken C++ compilers).
 ./configure || Exit 77
 
+# Ensure './libtool --help' will use the right tool versions.
+export AUTOCONF AUTOMAKE
+
 # Opportunistically check that --tag=CXX is used when supported.
 if ./libtool --help | grep tag=TAG; then
   $MAKE print >stdout || { cat stdout; Exit 1; }


hooks/post-receive
-- 
GNU Automake



reply via email to

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