]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Modernize, improve and/or tweak various test scripts.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 21 Jun 2010 16:07:09 +0000 (18:07 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 7 Nov 2010 10:45:44 +0000 (11:45 +0100)
* tests/stamph2.test: Improve m4 quoting in `configure.in', and
prefer trailing `:' over trailing `Exit 0'.
* tests/syntax.test: Escape literal dots in grep regexps.
* tests/copy.test: Enable `errexit' shell flag.  Extend test by
checking with `test' utility that the script `install-sh' is
copied, but not symlinked.
* tests/depdist.test: Move setting of `errexit' shell flag earlier
in the script (just after inclusion of ./defs).  Avoid obsoleted
constructs in generated `configure.in'.  Prefer to do our checks
by running configure and make over grepping Makefile.in.
* tests/target-cflags: Move setting of `errexit' shell flag
earlier in the script (just after inclusion of ./defs). Use the
`configure.in' stub created by `./defs', rather than writing it
from scratch.
* tests/target-clash: Do not uselessly run autoconf.
* tests/ctarget1.test: Renamed ...
* tests/cond-basic.test: ... to this.  Use the `configure.in' stub
created by `./defs', rather than writing it from scratch.
Move setting of `errexit' shell flag earlier in the script (just
after inclusion of ./defs).  Other minor cosmetic changes.
* tests/Makefile.am (TESTS): Updated.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/cond-basic.test [moved from tests/ctarget1.test with 81% similarity]
tests/copy.test
tests/depdist.test
tests/stamph2.test
tests/syntax.test
tests/target-cflags.test
tests/targetclash.test

index 2334c5c7bfa337b2ce65983a330159755109ea9d..26404a9f1c6bb005919b1a3638eff537606bc07d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2010-11-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       Modernize, improve and/or tweak various test scripts.
+       * tests/stamph2.test: Improve m4 quoting in `configure.in', and
+       prefer trailing `:' over trailing `Exit 0'.
+       * tests/syntax.test: Escape literal dots in grep regexps.
+       * tests/copy.test: Enable `errexit' shell flag.  Extend test by
+       checking with `test' utility that the script `install-sh' is
+       copied, but not symlinked.
+       * tests/depdist.test: Move setting of `errexit' shell flag earlier
+       in the script (just after inclusion of ./defs).  Avoid obsoleted
+       constructs in generated `configure.in'.  Prefer to do our checks
+       by running configure and make over grepping Makefile.in.
+       * tests/target-cflags: Move setting of `errexit' shell flag
+       earlier in the script (just after inclusion of ./defs). Use the
+       `configure.in' stub created by `./defs', rather than writing it
+       from scratch.
+       * tests/target-clash: Do not uselessly run autoconf.
+       * tests/ctarget1.test: Renamed ...
+       * tests/cond-basic.test: ... to this.  Use the `configure.in' stub
+       created by `./defs', rather than writing it from scratch.
+       Move setting of `errexit' shell flag earlier in the script (just
+       after inclusion of ./defs).  Other minor cosmetic changes.
+       * tests/Makefile.am (TESTS): Updated.
+
 2010-09-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Do not require "gzip" explicitly in tests.
index 58103ccb87592da2446c0226a55ab6d60e8cd04b..952f2dc1573f3ee5c1b8e573c5e71cdef952d07f 100644 (file)
@@ -161,6 +161,7 @@ compile.test \
 compile2.test \
 compile_f90_c_cxx.test \
 compile_f_c_cxx.test \
+cond-basic.test \
 cond.test \
 cond2.test \
 cond3.test \
@@ -233,7 +234,6 @@ confsub.test \
 confvar.test \
 confvar2.test \
 copy.test \
-ctarget1.test \
 cxx.test \
 cxx2.test \
 cxxansi.test \
index e967caae78a1222b34ac84799205801c72b814e1..b32ea5f48367e2bb6d1964334e7e542b3edcea94 100644 (file)
@@ -399,6 +399,7 @@ compile.test \
 compile2.test \
 compile_f90_c_cxx.test \
 compile_f_c_cxx.test \
+cond-basic.test \
 cond.test \
 cond2.test \
 cond3.test \
@@ -471,7 +472,6 @@ confsub.test \
 confvar.test \
 confvar2.test \
 copy.test \
-ctarget1.test \
 cxx.test \
 cxx2.test \
 cxxansi.test \
similarity index 81%
rename from tests/ctarget1.test
rename to tests/cond-basic.test
index d2191f687fcd61b8f4d23e2c1682a968dab2e8ef..0609ec113d6140ae622ae51508a94d0fe6c319d5 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-AM_CONDITIONAL(TEST, true)
-AC_OUTPUT(Makefile)
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([TEST], [true])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -34,11 +34,11 @@ target: false
 endif
 END
 
-set -e
-
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
 grep '^@TEST_TRUE@target: true' Makefile.in
 grep '^@TEST_TRUE@     action' Makefile.in
 grep '^@TEST_FALSE@target: false' Makefile.in
-Exit 0
+
+:
index 770ae516a3d2b33d013052b236eb3c065eb0a2bb..e4199a1a88f1fe59541db3347a4521a1e10a5f09 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
 
 . ./defs || Exit 1
 
+set -e
+
 : > Makefile.am
 rm -f install-sh
 
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE -c -a
+
+test -f install-sh
+test ! -h install-sh
+
+:
index f36eb471bffadf4ee0f13779f528b4c6362ae19e..f61ddf0624b9ee8c1daa12f34cb897b99a05251f 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 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
 
 . ./defs || Exit 1
 
+set -e
+
 rm -f configure.in
 
 mkdir config
 for i in *; do
-   if test $i != "config"; then
-      mv $i config
+   if test "$i" != "config"; then
+      mv -f "$i" config
    fi
 done
 
-cat > configure.in << 'END'
-AC_INIT(subdir/foo.c)
-AC_CONFIG_AUX_DIR(config)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([config])
+AM_INIT_AUTOMAKE
 AC_PROG_CC
-AC_OUTPUT(subdir/Makefile Makefile)
+AC_CONFIG_FILES([subdir/Makefile Makefile])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
 SUBDIRS = subdir
+check-local: test1 test2
+.PHONY: test1 test2
+test1:
+       echo ' ' $(DIST_COMMON) ' ' | grep '[ /]config/depcomp '
+test2: distdir
+       ls -l $(distdir)/*
+       test -f $(distdir)/config/depcomp
 END
 
 mkdir subdir
-: > subdir/foo.c
+cat > subdir/foo.c << 'END'
+int main(void)
+{
+  return 0;
+}
+END
 
 cat > subdir/Makefile.am << 'END'
 bin_PROGRAMS = foo
 foo_SOURCES = foo.c
 END
 
-set -e
-
 $ACLOCAL
-$AUTOMAKE --add-missing
 $AUTOCONF
-grep config/depcomp Makefile.in
+$AUTOMAKE --add-missing
+
+./configure
+
+$MAKE check
+$MAKE distcheck
+
+:
index cb96d278cda198be2c79eb31411114140e797067..aa077435883ea5b0edc3fbc49c64795a4e35567b 100755 (executable)
@@ -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
 set -e
 
 cat >> configure.in << END
-AM_CONFIG_HEADER(1.h
-                 2.h:config.hin
-                 3.h:sdir1/config1.hin)
+AM_CONFIG_HEADER([1.h
+                  2.h:config.hin
+                  3.h:sdir1/config1.hin])
 # AM_CONFIG_HEADER and AC_CONFIG_HEADERS should be synonyms.
-AC_CONFIG_HEADERS(sdir1/4.h
-                  sdir1/5.h:config.hin
-                  sdir1/6.h:sdir1/config1.hin
-                  sdir1/7.h:sdir2/config2.hin)
+AC_CONFIG_HEADERS([sdir1/4.h
+                   sdir1/5.h:config.hin
+                   sdir1/6.h:sdir1/config1.hin
+                   sdir1/7.h:sdir2/config2.hin])
 AC_OUTPUT
 END
 
@@ -68,4 +68,4 @@ test ! -f sdir1/stamp-h5
 test ! -f sdir1/stamp-h6
 test -f sdir1/stamp-h7
 
-Exit 0
+:
index 505486f0dff5c16b3f81709514585d4ac719c448..3b2a4e5fd2daef576890c35a3d76e5b89b07c401 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
@@ -28,4 +29,6 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile.am:2:.*blank line' stderr
+grep 'Makefile\.am:2:.*blank line' stderr
+
+:
index b324568d9275a4740b0004ee41b505b7cdc4b284..f3ac9ccd28df158768fad6f69bcd8517270d223e 100755 (executable)
 required=gcc
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(foo.c)
-AM_INIT_AUTOMAKE(target-cflags,0.0)
+set -e
+
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -54,8 +54,6 @@ int main(void)
 #endif
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
@@ -72,3 +70,5 @@ cd ..
 $MAKE
 ./foo
 ./bar
+
+:
index 0433b415527440c757225730a0958a7ca1daf8cb..87e37a8fb6b58eab595dc9008c76f0f83c80bbb5 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -30,6 +30,7 @@ bin_PROGRAMS = ctags
 END
 
 $ACLOCAL
-$AUTOCONF
 AUTOMAKE_fails -a
 grep 'redefinition.*ctags' stderr
+
+: