diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2010-11-07 11:50:06 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2010-11-07 11:50:06 +0100 |
commit | 1e460312d79fe15170e7519fb785e132ac7293fb (patch) | |
tree | 0ae596dbd16c0612ef52eb9f56179e6956b8cf67 | |
parent | 4555c818e5ae6a90a8116e9c5b5b1ff6a65929c0 (diff) | |
parent | 657ba885946a20a43dd556f45b8583c5bc016ebe (diff) | |
download | automake-1e460312d79fe15170e7519fb785e132ac7293fb.tar.gz |
Merge branch 'tests-misc-fixes-1'
Conflicts:
tests/Makefile.am
tests/Makefile.in
-rw-r--r-- | ChangeLog | 25 | ||||
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/Makefile.in | 2 | ||||
-rwxr-xr-x | tests/cond-basic.test (renamed from tests/ctarget1.test) | 20 | ||||
-rwxr-xr-x | tests/copy.test | 11 | ||||
-rwxr-xr-x | tests/depdist.test | 45 | ||||
-rwxr-xr-x | tests/stamph2.test | 18 | ||||
-rwxr-xr-x | tests/syntax.test | 7 | ||||
-rwxr-xr-x | tests/target-cflags.test | 12 | ||||
-rwxr-xr-x | tests/targetclash.test | 5 |
10 files changed, 101 insertions, 46 deletions
@@ -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-11-06 Stefano Lattarini <stefano.lattarini@gmail.com> New tests on obsoleted usages of automake/autoconf macros (such diff --git a/tests/Makefile.am b/tests/Makefile.am index d5ae6221d..33a0e8422 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -233,6 +233,7 @@ compile5.test \ compile6.test \ compile_f90_c_cxx.test \ compile_f_c_cxx.test \ +cond-basic.test \ cond.test \ cond2.test \ cond3.test \ @@ -309,7 +310,6 @@ copy.test \ cscope.test \ cscope2.test \ cscope3.test \ -ctarget1.test \ cxx.test \ cxx2.test \ cxxansi.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index deab171a1..0503cabfa 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -491,6 +491,7 @@ compile5.test \ compile6.test \ compile_f90_c_cxx.test \ compile_f_c_cxx.test \ +cond-basic.test \ cond.test \ cond2.test \ cond3.test \ @@ -567,7 +568,6 @@ copy.test \ cscope.test \ cscope2.test \ cscope3.test \ -ctarget1.test \ cxx.test \ cxx2.test \ cxxansi.test \ diff --git a/tests/ctarget1.test b/tests/cond-basic.test index d2191f687..0609ec113 100755 --- a/tests/ctarget1.test +++ b/tests/cond-basic.test @@ -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 @@ -18,11 +18,11 @@ . ./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 + +: diff --git a/tests/copy.test b/tests/copy.test index 770ae516a..e4199a1a8 100755 --- a/tests/copy.test +++ b/tests/copy.test @@ -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 @@ -18,8 +18,15 @@ . ./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 + +: diff --git a/tests/depdist.test b/tests/depdist.test index f36eb471b..f61ddf062 100755 --- a/tests/depdist.test +++ b/tests/depdist.test @@ -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 @@ -19,38 +19,57 @@ . ./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 + +: diff --git a/tests/stamph2.test b/tests/stamph2.test index cb96d278c..aa0774358 100755 --- a/tests/stamph2.test +++ b/tests/stamph2.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,14 +20,14 @@ 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 +: diff --git a/tests/syntax.test b/tests/syntax.test index 505486f0d..3b2a4e5fd 100755 --- a/tests/syntax.test +++ b/tests/syntax.test @@ -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 + +: diff --git a/tests/target-cflags.test b/tests/target-cflags.test index b324568d9..f3ac9ccd2 100755 --- a/tests/target-cflags.test +++ b/tests/target-cflags.test @@ -21,12 +21,12 @@ 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 + +: diff --git a/tests/targetclash.test b/tests/targetclash.test index 0433b4155..87e37a8fb 100755 --- a/tests/targetclash.test +++ b/tests/targetclash.test @@ -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 + +: |