automake-patches
[Top][All Lists]
Advanced

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

[PATCH] Modernize, improve and/or extend test scripts `conf*.test'.


From: Stefano Lattarini
Subject: [PATCH] Modernize, improve and/or extend test scripts `conf*.test'.
Date: Sun, 27 Jun 2010 18:14:41 +0200
User-agent: KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.4; i686; ; )

More testsuite tweakings.  But this patch also contains some "real"
improvements and useful extensions IMO.

Regards,
    Stefano

-*-*-*-

Modernize, improve and/or extend test scripts `conf*.test'.

* tests/confh5.test: Cosmetic changes.
* tests/conff.test: Likewise.
* tests/confdeps.test: Likewise.
* tests/conflnk.test: Likewise.
* tests/conflnk2.test: Likewise.
* tests/confsub.test: Likewise.
* tests/confvar.test: Likewise, and make grepping of Makefile.in
stricter.
* tests/confvar2.test: Likewise.
* tests/conflnk3.test: Cosmetic changes, and re-enable a temporarly
disabled test (which didn't work with autoconf <= 2.59, but now we
are requiring autoconf 2.62, so...)
* tests/conflnk4.test: Cosmetic changes, and extend existing tests
accordingly to "TODO" comments.
* tests/conff2.test: Make grepping of Automake's stderr stricter.
Add some comments explaining why we don't use the `configure.in'
stub preset be ./defs.
* tests/confh.test: Use the `configure.in' stub created by ./defs,
rather than writing one from scratch, and do not call AC_OUTPUT.
Enable `errexit' shell flag, and related changes.  Prefer diff over
cmp to compare text files. Prefer perl over sed to fetch the value
of $(DIST_COMMON) from Makefile.in.  Make grepping of the contents
of $(DIST_COMMON) stricter.
* tests/confh4.test: Use the `configure.in' stub created by ./defs,
rather than writing one from scratch.  Make grepping of Makefile.in
stricter.
* tests/confh5.test: Make grepping of `config.h' stricter.  Add a
comment.
* tests/configure.test: Avoid obsolescent constructs in generated
`configure.ac'.  Do not write `configure.in' two times.  Escape
literal dots in grep regular expressions.
* tests/confincl.test:  Enable `errexit' shell flag, and related
changes.  Prefer fgrep over grep.  Other cosmetic changes.
* tests/config.test: Renamed to ...
* tests/confh3.test: ... this.  Fix m4 quoting in `configure.in',
and make grepping of `config.h' and `config.h.in' stricter.
* tests/conf2.test: Renamed ...
* tests/confh2.test: ... to this.  Use the `configure.in' stub
created by ./defs, rather than writing one from scratch.  Try to
run the checks both with and without AC_PROG_CC and AC_OUTPUT in
`configure.in'.
* tests/Makefile.am (TESTS): Updated.
---
 ChangeLog                          |   46 +++++++++++++++++++++++++++++++++
 tests/Makefile.am                  |    4 +-
 tests/Makefile.in                  |    4 +-
 tests/confdeps.test                |    2 +-
 tests/conff.test                   |    4 ++-
 tests/conff2.test                  |   10 +++++--
 tests/confh.test                   |   50 ++++++++++++++++++-----------------
 tests/{conf2.test => confh2.test}  |   20 ++++++++++----
 tests/{config.test => confh3.test} |    9 +++---
 tests/confh4.test                  |   13 +++++----
 tests/confh5.test                  |   15 +++++++---
 tests/configure.test               |   31 ++++++++--------------
 tests/confincl.test                |   19 +++++++------
 tests/conflnk.test                 |   14 +++++-----
 tests/conflnk2.test                |   13 ++++++---
 tests/conflnk3.test                |   23 ++++++++--------
 tests/conflnk4.test                |   17 +++++++-----
 tests/confsub.test                 |   14 ++++++----
 tests/confvar.test                 |    8 +++--
 tests/confvar2.test                |    8 ++++-
 20 files changed, 200 insertions(+), 124 deletions(-)
 rename tests/{conf2.test => confh2.test} (84%)
 rename tests/{config.test => confh3.test} (84%)
From 8b6cd66cd2b80f6f3ee3833604c50551acde33e6 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sat, 19 Jun 2010 01:32:14 +0200
Subject: [PATCH] Modernize, improve and/or extend test scripts `conf*.test'.

* tests/confh5.test: Cosmetic changes.
* tests/conff.test: Likewise.
* tests/confdeps.test: Likewise.
* tests/conflnk.test: Likewise.
* tests/conflnk2.test: Likewise.
* tests/confsub.test: Likewise.
* tests/confvar.test: Likewise, and make grepping of Makefile.in
stricter.
* tests/confvar2.test: Likewise.
* tests/conflnk3.test: Cosmetic changes, and re-enable a temporarly
disabled test (which didn't work with autoconf <= 2.59, but now we
are requiring autoconf 2.62, so...)
* tests/conflnk4.test: Cosmetic changes, and extend existing tests
accordingly to "TODO" comments.
* tests/conff2.test: Make grepping of Automake's stderr stricter.
Add some comments explaining why we don't use the `configure.in'
stub preset be ./defs.
* tests/confh.test: Use the `configure.in' stub created by ./defs,
rather than writing one from scratch, and do not call AC_OUTPUT.
Enable `errexit' shell flag, and related changes.  Prefer diff over
cmp to compare text files. Prefer perl over sed to fetch the value
of $(DIST_COMMON) from Makefile.in.  Make grepping of the contents
of $(DIST_COMMON) stricter.
* tests/confh4.test: Use the `configure.in' stub created by ./defs,
rather than writing one from scratch.  Make grepping of Makefile.in
stricter.
* tests/confh5.test: Make grepping of `config.h' stricter.  Add a
comment.
* tests/configure.test: Avoid obsolescent constructs in generated
`configure.ac'.  Do not write `configure.in' two times.  Escape
literal dots in grep regular expressions.
* tests/confincl.test:  Enable `errexit' shell flag, and related
changes.  Prefer fgrep over grep.  Other cosmetic changes.
* tests/config.test: Renamed to ...
* tests/confh3.test: ... this.  Fix m4 quoting in `configure.in',
and make grepping of `config.h' and `config.h.in' stricter.
* tests/conf2.test: Renamed ...
* tests/confh2.test: ... to this.  Use the `configure.in' stub
created by ./defs, rather than writing one from scratch.  Try to
run the checks both with and without AC_PROG_CC and AC_OUTPUT in
`configure.in'.
* tests/Makefile.am (TESTS): Updated.
---
 ChangeLog                          |   46 +++++++++++++++++++++++++++++++++
 tests/Makefile.am                  |    4 +-
 tests/Makefile.in                  |    4 +-
 tests/confdeps.test                |    2 +-
 tests/conff.test                   |    4 ++-
 tests/conff2.test                  |   10 +++++--
 tests/confh.test                   |   50 ++++++++++++++++++-----------------
 tests/{conf2.test => confh2.test}  |   20 ++++++++++----
 tests/{config.test => confh3.test} |    9 +++---
 tests/confh4.test                  |   13 +++++----
 tests/confh5.test                  |   15 +++++++---
 tests/configure.test               |   31 ++++++++--------------
 tests/confincl.test                |   19 +++++++------
 tests/conflnk.test                 |   14 +++++-----
 tests/conflnk2.test                |   13 ++++++---
 tests/conflnk3.test                |   23 ++++++++--------
 tests/conflnk4.test                |   17 +++++++-----
 tests/confsub.test                 |   14 ++++++----
 tests/confvar.test                 |    8 +++--
 tests/confvar2.test                |    8 ++++-
 20 files changed, 200 insertions(+), 124 deletions(-)
 rename tests/{conf2.test => confh2.test} (84%)
 rename tests/{config.test => confh3.test} (84%)

diff --git a/ChangeLog b/ChangeLog
index b5f1433..27415e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,49 @@
+2010-06-27  Stefano Lattarini  <address@hidden>
+
+       Modernize, improve and/or extend test scripts `conf*.test'.
+       * tests/confh5.test: Cosmetic changes.
+       * tests/conff.test: Likewise.
+       * tests/confdeps.test: Likewise.
+       * tests/conflnk.test: Likewise.
+       * tests/conflnk2.test: Likewise.
+       * tests/confsub.test: Likewise.
+       * tests/confvar.test: Likewise, and make grepping of Makefile.in
+       stricter.
+       * tests/confvar2.test: Likewise.
+       * tests/conflnk3.test: Cosmetic changes, and re-enable a temporarly
+       disabled test (which didn't work with autoconf <= 2.59, but now we
+       are requiring autoconf 2.62, so...)
+       * tests/conflnk4.test: Cosmetic changes, and extend existing tests
+       accordingly to "TODO" comments.
+       * tests/conff2.test: Make grepping of Automake's stderr stricter.
+       Add some comments explaining why we don't use the `configure.in'
+       stub preset be ./defs.
+       * tests/confh.test: Use the `configure.in' stub created by ./defs,
+       rather than writing one from scratch, and do not call AC_OUTPUT.
+       Enable `errexit' shell flag, and related changes.  Prefer diff over
+       cmp to compare text files. Prefer perl over sed to fetch the value
+       of $(DIST_COMMON) from Makefile.in.  Make grepping of the contents
+       of $(DIST_COMMON) stricter.
+       * tests/confh4.test: Use the `configure.in' stub created by ./defs,
+       rather than writing one from scratch.  Make grepping of Makefile.in
+       stricter.
+       * tests/confh5.test: Make grepping of `config.h' stricter.  Add a
+       comment.
+       * tests/configure.test: Avoid obsolescent constructs in generated
+       `configure.ac'.  Do not write `configure.in' two times.  Escape
+       literal dots in grep regular expressions.
+       * tests/confincl.test:  Enable `errexit' shell flag, and related
+       changes.  Prefer fgrep over grep.  Other cosmetic changes.
+       * tests/config.test: Renamed to ...
+       * tests/confh3.test: ... this.  Fix m4 quoting in `configure.in',
+       and make grepping of `config.h' and `config.h.in' stricter.
+       * tests/conf2.test: Renamed ...
+       * tests/confh2.test: ... to this.  Use the `configure.in' stub
+       created by ./defs, rather than writing one from scratch.  Try to
+       run the checks both with and without AC_PROG_CC and AC_OUTPUT in
+       `configure.in'.
+       * tests/Makefile.am (TESTS): Updated.
+
 2010-06-13  Stefano Lattarini  <address@hidden>
 
        Add useful comment in test script obsolete.test.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2771a66..457c9f4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -232,14 +232,14 @@ condlib.test \
 condman.test \
 condman2.test \
 configure.test \
-conf2.test \
 confdeps.test \
 conff.test \
 conff2.test \
 confh.test \
+confh2.test \
+confh3.test \
 confh4.test \
 confh5.test \
-config.test \
 confincl.test \
 conflnk.test \
 conflnk2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index db53cfb..0d186a6 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -443,14 +443,14 @@ condlib.test \
 condman.test \
 condman2.test \
 configure.test \
-conf2.test \
 confdeps.test \
 conff.test \
 conff2.test \
 confh.test \
+confh2.test \
+confh3.test \
 confh4.test \
 confh5.test \
-config.test \
 confincl.test \
 conflnk.test \
 conflnk2.test \
diff --git a/tests/confdeps.test b/tests/confdeps.test
index 60e7136..679e801 100755
--- a/tests/confdeps.test
+++ b/tests/confdeps.test
@@ -36,4 +36,4 @@ mv -f aclocal.m4t aclocal.m4
 $AUTOMAKE
 grep '^\$(ACLOCAL_M4):' Makefile.in && Exit 1
 
-Exit 0
+:
diff --git a/tests/conff.test b/tests/conff.test
index 353cb8e..dc6677c 100755
--- a/tests/conff.test
+++ b/tests/conff.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
@@ -93,3 +93,5 @@ grep 'bot2 rule' stdout
 cd ..
 
 $MAKE distcheck
+
+:
diff --git a/tests/conff2.test b/tests/conff2.test
index 0c53067..a0101e1 100755
--- a/tests/conff2.test
+++ b/tests/conff2.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
@@ -20,6 +20,8 @@
 
 set -e
 
+# We avoid using configure.in stub initialized by ./defs, since we need
+# to keep track of line numbers (to grep for error messages).
 cat > configure.in << END
 AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE
@@ -30,5 +32,7 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'configure.in:3:.*AC_CONFIG_FILES' stderr
-grep 'configure.in:4:.*AC_CONFIG_HEADERS' stderr
+grep 'configure\.in:3:.* arguments .*AC_CONFIG_FILES' stderr
+grep 'configure\.in:4:.* arguments .*AC_CONFIG_HEADERS' stderr
+
+:
diff --git a/tests/confh.test b/tests/confh.test
index 772a763..552ce5c 100755
--- a/tests/confh.test
+++ b/tests/confh.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 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
@@ -19,11 +20,10 @@
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AM_CONFIG_HEADER(include/config.h)
-AC_OUTPUT(Makefile include/Makefile)
+set -e
+
+cat >> configure.in << 'END'
+AM_CONFIG_HEADER([include/config.h])
 END
 
 : > Makefile.am
@@ -33,24 +33,26 @@ mkdir include
 : > include/Makefile.am
 : > include/config.h.in
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
-
-(sed -n -e '/^DIST_COMMON =.*\\$/ {
-   :loop
-   p
-   n
-   t clear
-   :clear
-   s/\\$/\\/
-   t loop
-   p
-   n
-   }' -e '/^DIST_COMMON =/ p' Makefile.in | grep acconfig.h) || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+perl -ne '
+if (s/^DIST_COMMON *=//)
+{
+  $_ .= <> while (s/\\$//);
+  $_ = " $_ ";
+  s/\s+/ /g;
+  print "$_\n";
+  exit 0;
+}' Makefile.in > dc.txt
+cat dc.txt # might be useful for debugging.
+$FGREP ' acconfig.h ' dc.txt
 
 # Make sure re-running automake in a different way generates same
 # Makefile.in.
-mv Makefile.in save
-$ACLOCAL || Exit 1
-$AUTOMAKE Makefile || Exit 1
-cmp Makefile.in save
+mv Makefile.in Makefile.sav
+$ACLOCAL
+$AUTOMAKE Makefile
+diff Makefile.sav Makefile.in
+
+:
diff --git a/tests/conf2.test b/tests/confh2.test
similarity index 84%
rename from tests/conf2.test
rename to tests/confh2.test
index 8e53733..fce254e 100755
--- a/tests/conf2.test
+++ b/tests/confh2.test
@@ -21,12 +21,8 @@
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AM_CONFIG_HEADER(config.h two.h)
-AC_PROG_CC
-AC_OUTPUT(Makefile)
+cat >> configure.in << 'END'
+AM_CONFIG_HEADER([config.h two.h])
 END
 
 : > Makefile.am
@@ -36,3 +32,15 @@ END
 
 $ACLOCAL
 $AUTOMAKE
+
+# Try again with more macros.
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+:
diff --git a/tests/config.test b/tests/confh3.test
similarity index 84%
rename from tests/config.test
rename to tests/confh3.test
index bed9a92..de55be7 100755
--- a/tests/config.test
+++ b/tests/confh3.test
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2000, 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
@@ -24,7 +25,7 @@ required=GNUmake
 set -e
 
 cat >> configure.in << 'END'
-AM_CONFIG_HEADER(subdir/config.h)
+AM_CONFIG_HEADER([subdir/config.h])
 AC_OUTPUT
 END
 
@@ -39,8 +40,8 @@ $AUTOMAKE
 $MAKE
 
 $sleep
-echo '#define FOO' > subdir/config.h.in
+echo '#define gRePmE' > subdir/config.h.in
 $MAKE subdir/config.h
-grep FOO subdir/config.h
+$FGREP gRePmE subdir/config.h
 
 $MAKE distcheck
diff --git a/tests/confh4.test b/tests/confh4.test
index 6fd4a07..bab2d53 100755
--- a/tests/confh4.test
+++ b/tests/confh4.test
@@ -27,12 +27,11 @@
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AM_CONFIG_HEADER(include/config.h)
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([include/Makefile])
+AM_CONFIG_HEADER([include/config.h])
 AC_PROG_CC
-AC_OUTPUT(Makefile include/Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -50,4 +49,6 @@ mkdir include
 $ACLOCAL
 $AUTOMAKE
 
-$EGREP '^DEFAULT_INCLUDES =.* -I(\.|\$\(top_builddir\))/include' Makefile.in
+grep '^DEFAULT_INCLUDES =.* -I\$(top_builddir)/include' Makefile.in
+
+:
diff --git a/tests/confh5.test b/tests/confh5.test
index febe000..9af83dc 100755
--- a/tests/confh5.test
+++ b/tests/confh5.test
@@ -21,14 +21,15 @@
 set -e
 
 cat >> configure.in << 'END'
-AC_SUBST([FOO], [name])
-AC_CONFIG_FILES(include/config.h.in)
-AC_CONFIG_HEADERS(config.h)
-AC_CONFIG_HEADERS(include/config.h)
+AC_SUBST([FOO], [NameToBeGrepped])
+AC_CONFIG_FILES([include/config.h.in])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([include/config.h])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
+.PHONY: test
 test: distdir
        test -f $(distdir)/config.h.in
        test -f $(distdir)/include/config.h.in.in
@@ -51,6 +52,10 @@ $MAKE
 $sleep
 echo '#undef @FOO@' > include/config.h.in.in
 $MAKE include/config.h
-grep '/\*.*#undef.*name' include/config.h
+# Don't try to be too strict in this grepping, since the substutition
+# is done by config.status, and we don't have too much control on it.
+grep '/\*.*#undef.*NameToBeGrepped' include/config.h
 $MAKE test
 $MAKE distcheck
+
+:
diff --git a/tests/configure.test b/tests/configure.test
index 838da68..0773a00 100755
--- a/tests/configure.test
+++ b/tests/configure.test
@@ -21,45 +21,36 @@
 
 set -e
 
-cat >configure.ac <<\EOF
-AC_INIT
-AM_INIT_AUTOMAKE([configure], [1.0])
+cat >configure.ac <<EOF
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
 EOF
 
 cat >configure.in <<EOF
-AC_INIT([configure], [1.0])
+AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE([an-invalid-automake-option])
 AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-EOF
-
-cat >configure.in <<EOF
-AC_INIT([configure], [1.0])
-AM_INIT_AUTOMAKE([an-invalid-automake-option])
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
 EOF
 
 : >Makefile.am
 
 $ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
-grep 'configure.ac.*configure.in.*both present' stderr
+grep 'configure\.ac.*configure\.in.*both present' stderr
 
 $ACLOCAL -Wno-error 2>stderr || { cat stderr >&2; Exit 1; }
 cat stderr >&2
-grep 'configure.ac.*configure.in.*both present' stderr
-grep 'proceeding.*configure.ac' stderr
+grep 'configure\.ac.*configure\.in.*both present' stderr
+grep 'proceeding.*configure\.ac' stderr
 
 # Ensure we really proceed with configure.ac.
 AUTOMAKE_fails -Werror
-grep 'configure.ac.*configure.in.*both present' stderr
-grep 'proceeding.*configure.ac' stderr
+grep 'configure\.ac.*configure\.in.*both present' stderr
+grep 'proceeding.*configure\.ac' stderr
 
 AUTOMAKE_run 0 -Wno-error
-grep 'configure.ac.*configure.in.*both present' stderr
-grep 'proceeding.*configure.ac' stderr
+grep 'configure\.ac.*configure\.in.*both present' stderr
+grep 'proceeding.*configure\.ac' stderr
 
 :
diff --git a/tests/confincl.test b/tests/confincl.test
index dd0b63e..c4f0cde 100755
--- a/tests/confincl.test
+++ b/tests/confincl.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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,18 +20,19 @@
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 END
 
-cat > Makefile.am << 'EOF'
+cat > Makefile.am << 'END'
 bin_PROGRAMS = fred
-EOF
+END
+
+$ACLOCAL
+$AUTOMAKE
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$FGREP '@CONFIG_INCLUDE_SPEC@' Makefile.in && Exit 1
 
-if grep '@CONFIG_INCLUDE_SPEC@' Makefile.in; then
-   Exit 1
-fi
-Exit 0
+:
diff --git a/tests/conflnk.test b/tests/conflnk.test
index 6bc5970..8dfafbc 100755
--- a/tests/conflnk.test
+++ b/tests/conflnk.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
@@ -29,12 +29,12 @@ mkdir sdir
 mkdir sdir-no-make
 
 cat >>configure.in << 'EOF'
-AC_CONFIG_FILES(sdir/Makefile)
-AC_CONFIG_LINKS(dest:src)
-AC_CONFIG_LINKS(dest2:src)
-AC_CONFIG_LINKS(sdir/dest3:src)
-AC_CONFIG_LINKS(dest4:sdir/src2)
-AC_CONFIG_LINKS(sdir/dest5:sdir/src2 sdir-no-make/dest6:src)
+AC_CONFIG_FILES([sdir/Makefile])
+AC_CONFIG_LINKS([dest:src])
+AC_CONFIG_LINKS([dest2:src])
+AC_CONFIG_LINKS([sdir/dest3:src])
+AC_CONFIG_LINKS([dest4:sdir/src2])
+AC_CONFIG_LINKS([sdir/dest5:sdir/src2 sdir-no-make/dest6:src])
 AC_OUTPUT
 EOF
 
diff --git a/tests/conflnk2.test b/tests/conflnk2.test
index 8a045be..8c68c38 100755
--- a/tests/conflnk2.test
+++ b/tests/conflnk2.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
@@ -23,6 +23,7 @@ set -e
 
 cat > Makefile.am << 'END'
 SUBDIRS = sdir
+.PHONY: test
 test: distdir
        test -f $(distdir)/src
        test -f $(distdir)/src2
@@ -42,10 +43,10 @@ mkdir sdir-no-make
 : > sdir-no-make/src4
 
 cat >>configure.in << 'EOF'
-AC_CONFIG_FILES(sdir/Makefile)
-AC_CONFIG_LINKS(dest:src)
-AC_CONFIG_LINKS(sdir/dest2:src2 sdir-no-make/dest3:sdir/src3)
-AC_CONFIG_LINKS(sdir/dest4:sdir-no-make/src4)
+AC_CONFIG_FILES([sdir/Makefile])
+AC_CONFIG_LINKS([dest:src])
+AC_CONFIG_LINKS([sdir/dest2:src2 sdir-no-make/dest3:sdir/src3])
+AC_CONFIG_LINKS([sdir/dest4:sdir-no-make/src4])
 AC_OUTPUT
 EOF
 
@@ -54,3 +55,5 @@ $AUTOMAKE
 $AUTOCONF
 ./configure
 $MAKE test
+
+:
diff --git a/tests/conflnk3.test b/tests/conflnk3.test
index 00e9da2..20f4786 100755
--- a/tests/conflnk3.test
+++ b/tests/conflnk3.test
@@ -23,6 +23,7 @@ set -e
 
 cat > Makefile.am << 'END'
 SUBDIRS = sdir
+.PHONY: test
 test: distdir
        test ! -r $(distdir)/sdir/dest3
        test ! -r $(distdir)/sdir/dest2
@@ -41,16 +42,16 @@ mkdir sdir
 : > sdir/src3
 
 cat >>configure.in << 'EOF'
-AC_CONFIG_FILES(sdir/Makefile)
+AC_CONFIG_FILES([sdir/Makefile])
 my_src_dir=sdir
 my_dest=dest
-AC_CONFIG_LINKS(sdir/dest2:src2 sdir/dest3:$my_src_dir/src3)
-AC_CONFIG_LINKS($my_dest:src)
+AC_CONFIG_LINKS([sdir/dest2:src2 sdir/dest3:$my_src_dir/src3])
+AC_CONFIG_LINKS([$my_dest:src])
 # the following is a link whose source is itself a link
-AC_CONFIG_LINKS(dest4:sdir/dest2)
+AC_CONFIG_LINKS([dest4:sdir/dest2])
 # Some package prefer to compute links.
 cmplink='dest5:src';
-AC_CONFIG_LINKS($cmplink)
+AC_CONFIG_LINKS([$cmplink])
 AC_OUTPUT
 EOF
 
@@ -79,9 +80,9 @@ test -r dest5 # ditto
 rm -f dest dest5
 test ! -r dest4
 
-## Cannot do the following, because at the time of writing Autoconf
-## (2.59) does not support AC_CONFIG_LINKS source in the build tree.
-# mkdir build
-# cd build
-# ../configure
-# $MAKE test
+mkdir build
+cd build
+../configure
+$MAKE test
+
+:
diff --git a/tests/conflnk4.test b/tests/conflnk4.test
index 4bedf52..fd96054 100755
--- a/tests/conflnk4.test
+++ b/tests/conflnk4.test
@@ -34,17 +34,20 @@ mkdir nonmk-subdir sdir sdir/mk-subdir
 
 cat >> Makefile.am <<'EOF'
 SUBDIRS = sdir
+.PHONY: test
 test: distdir
        test -f $(distdir)/src
        test -f $(distdir)/sdir/src2
+       test -f $(distdir)/nonmk-subdir/src3
+       test -f $(distdir)/sdir/mk-subdir/src4
 EOF
 
 cat >>configure.in << 'EOF'
-AC_CONFIG_FILES(sdir/Makefile)
-AC_CONFIG_LINKS(src:src)
-AC_CONFIG_LINKS(sdir/src2:sdir/src2)
-AC_CONFIG_LINKS(nonmk-subdir/src3:nonmk-subdir/src3)
-AC_CONFIG_LINKS(sdir/mk-subdir/src4:sdir/mk-subdir/src4)
+AC_CONFIG_FILES([sdir/Makefile])
+AC_CONFIG_LINKS([src:src])
+AC_CONFIG_LINKS([sdir/src2:sdir/src2])
+AC_CONFIG_LINKS([nonmk-subdir/src3:nonmk-subdir/src3])
+AC_CONFIG_LINKS([sdir/mk-subdir/src4:sdir/mk-subdir/src4])
 AC_OUTPUT
 EOF
 
@@ -56,7 +59,6 @@ mkdir build
 cd build
 ../configure
 
-# TODO: Make sure links are distributed
 $MAKE test
 
 # Make sure nothing is deleted by `make clean'
@@ -84,7 +86,6 @@ test -r sdir/mk-subdir/src4 && Exit 1
 cd ..
 ./configure
 
-# TODO: Make sure links are distributed
 $MAKE test
 
 # Make sure nothing is deleted by `make distclean'
@@ -94,3 +95,5 @@ test -f src
 test -f sdir/src2
 test -f nonmk-subdir/src3
 test -f sdir/mk-subdir/src4
+
+:
diff --git a/tests/confsub.test b/tests/confsub.test
index 65ec91b..a0d4fe3 100755
--- a/tests/confsub.test
+++ b/tests/confsub.test
@@ -39,8 +39,8 @@ END
 
 echo 'Before.' > subdir/config.hin
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
 
 # Make sure subdir Makefile.in doesn't itself look in the subdir.
 # One line is allowed though:
@@ -49,11 +49,13 @@ $AUTOMAKE || Exit 1
 ($FGREP 'subdir/config.h' subdir/Makefile.in |
    $FGREP -v 'cd $(top_builddir)') && Exit 1
 
-$AUTOCONF || Exit 1
-./configure || Exit 1
+$AUTOCONF
+./configure
 $FGREP 'Before.' subdir/config.h
 
 $sleep
 echo 'After.' > subdir/config.hin
-$MAKE || Exit 1
-$FGREP 'After.' subdir/config.h || Exit 1
+$MAKE
+$FGREP 'After.' subdir/config.h
+
+:
diff --git a/tests/confvar.test b/tests/confvar.test
index 99811b0..13cc7dd 100755
--- a/tests/confvar.test
+++ b/tests/confvar.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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
@@ -21,7 +21,7 @@
 set -e
 
 cat >> configure.in << 'END'
-AC_SUBST(QBERT)
+AC_SUBST([QBERT])
 END
 
 : > Makefile.am
@@ -29,4 +29,6 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-grep '^QBERT' Makefile.in
+grep '^QBERT =' Makefile.in
+
+:
diff --git a/tests/confvar2.test b/tests/confvar2.test
index 75c02dc..1cfd2d3 100755
--- a/tests/confvar2.test
+++ b/tests/confvar2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1996, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 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
@@ -21,7 +21,7 @@
 set -e
 
 cat >> configure.in << 'END'
-AC_SUBST(OTHER_SCRIPTS)
+AC_SUBST([OTHER_SCRIPTS])
 END
 
 cat > Makefile.am << 'END'
@@ -30,3 +30,7 @@ END
 
 $ACLOCAL
 $AUTOMAKE
+
+grep '^OTHER_SCRIPTS =' Makefile.in
+
+:
-- 
1.6.5


reply via email to

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