From 005000e7a47e75d051473ad326983be6448738b6 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Thu, 3 Nov 2011 15:09:05 +0100 Subject: [PATCH] tests: various minor tweakings, mostly related to AM_PROG_AR * tests/alloca.test: Adjust to new portability requirements due to the new AM_PROG_AR macro. * tests/discover.test: Likewise. * tests/libobj3.test: Likewise. * tests/pluseq7.test: Likewise. Also, make grepping of automake expected error message stricter. * tests/stdlib.test: Likewise, and extend the test a bit. * tests/parse.test (configure.in): Remove redundant call to AC_PROG_RANLIB. * tests/library2.test: Adjust to new portability requirements due to the new AM_PROG_AR macro. Also ... (configure.in): ... add call to AC_PROG_CC, to ensure automake really fails for the expected reason. --- ChangeLog | 17 +++++++++++++++++ tests/alloca.test | 4 +++- tests/discover.test | 4 +++- tests/libobj3.test | 6 +++++- tests/library2.test | 8 ++++++-- tests/parse.test | 4 ++-- tests/pluseq7.test | 9 +++++---- tests/stdlib.test | 25 ++++++++++++++++++++++--- 8 files changed, 63 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd0a16521..06887360c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2011-11-03 Stefano Lattarini + + tests: various minor tweakings, mostly related to AM_PROG_AR + * tests/alloca.test: Adjust to new portability requirements due + to the new AM_PROG_AR macro. + * tests/discover.test: Likewise. + * tests/libobj3.test: Likewise. + * tests/pluseq7.test: Likewise. Also, make grepping of automake + expected error message stricter. + * tests/stdlib.test: Likewise, and extend the test a bit. + * tests/parse.test (configure.in): Remove redundant call to + AC_PROG_RANLIB. + * tests/library2.test: Adjust to new portability requirements + due to the new AM_PROG_AR macro. Also ... + (configure.in): ... add call to AC_PROG_CC, to ensure automake + really fails for the expected reason. + 2011-11-03 Zack Weinberg (tiny change) Stefano Lattarini diff --git a/tests/alloca.test b/tests/alloca.test index 8a1e06e37..630400215 100755 --- a/tests/alloca.test +++ b/tests/alloca.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 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 @@ -21,6 +21,7 @@ set -e cat >> configure.in <<'END' +AM_PROG_AR AC_PROG_CC END @@ -31,6 +32,7 @@ libtu_a_LIBADD = @ALLOCA@ END : > alloca.c +: > ar-lib $ACLOCAL AUTOMAKE_fails diff --git a/tests/discover.test b/tests/discover.test index 0e4faa3b1..41b11f51e 100755 --- a/tests/discover.test +++ b/tests/discover.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2010 Free Software +# Copyright (C) 1996, 1997, 2000, 2001, 2002, 2010, 2011 Free Software # Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -21,6 +21,7 @@ cat >> configure.in << 'END' AC_PROG_RANLIB +AM_PROG_AR AC_PROG_CC AC_LIBOBJ([fsusage]) AC_OUTPUT @@ -33,6 +34,7 @@ libtu_a_LIBADD = @LIBOBJS@ END : > fsusage.c +: > ar-lib $ACLOCAL AUTOMAKE_fails diff --git a/tests/libobj3.test b/tests/libobj3.test index 0aeced91b..7304b0937 100755 --- a/tests/libobj3.test +++ b/tests/libobj3.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 1997, 2001, 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 2001, 2002, 2003, 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 @@ -22,6 +23,7 @@ set -e cat >> configure.in << 'END' AC_PROG_RANLIB +AM_PROG_AR END cat > Makefile.am << 'END' @@ -30,6 +32,8 @@ libtu_a_SOURCES = libtu_a_LIBADD = @LIBOBJS@ END +: > ar-lib + $ACLOCAL AUTOMAKE_fails grep 'Makefile.am:3:.*LIBOBJS' stderr diff --git a/tests/library2.test b/tests/library2.test index 0dbff2899..d30c504d5 100755 --- a/tests/library2.test +++ b/tests/library2.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 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 @@ -20,10 +20,14 @@ set -e +cat >> configure.in << 'END' +AC_PROG_CC +END + cat > Makefile.am << 'END' EXTRA_LIBRARIES = libfoo.a END $ACLOCAL -AUTOMAKE_fails +AUTOMAKE_fails -Wno-portability grep AC_PROG_RANLIB stderr diff --git a/tests/parse.test b/tests/parse.test index e7dcbe5df..bf5b63a26 100755 --- a/tests/parse.test +++ b/tests/parse.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1998, 2000, 2001, 2002, 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 @@ -22,7 +23,6 @@ cat > configure.in << 'END' AC_INIT AM_INIT_AUTOMAKE(nonesuch, nonesuch) AC_PROG_CC -AC_PROG_RANLIB AC_OUTPUT(Makefile) END diff --git a/tests/pluseq7.test b/tests/pluseq7.test index 071646208..31a42464d 100755 --- a/tests/pluseq7.test +++ b/tests/pluseq7.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 1999, 2001, 2002, 2003, 2010 Free Software Foundation, -# Inc. +# Copyright (C) 1999, 2001, 2002, 2003, 2010, 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 @@ -34,7 +34,8 @@ AR += qq END $ACLOCAL -AUTOMAKE_fails -grep 'Makefile.am:3:.*AR' stderr +AUTOMAKE_fails -Wno-portability +q="[\`'\"]" +grep "^Makefile\.am:3:.* AR .* with $q=$q before .*$q+=$q" stderr : diff --git a/tests/stdlib.test b/tests/stdlib.test index 48f56fc25..5ca9a7ff2 100755 --- a/tests/stdlib.test +++ b/tests/stdlib.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 1996, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1996, 2001, 2002, 2003, 2004, 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 @@ -22,15 +23,33 @@ set -e cat >> configure.in << 'END' AC_PROG_CC +AM_PROG_AR AC_PROG_RANLIB END cat > Makefile.am << 'END' noinst_LIBRARIES = sub/foo +include $(srcdir)/foo.mk END +cat > foo.mk << 'END' +## A dummy automake comment. +a = x \ + y +# A dummy make comment. +lib_LIBRARIES = zardoz.a +END + +: > ar-lib + $ACLOCAL AUTOMAKE_fails +q="[\`'\"]" +badname='not a standard library name' # We're specifically testing for line-number information. -grep 'Makefile.am:1:.*sub/foo.*standard library name' stderr -grep 'Makefile.am:1:.*sub/libfoo.a.*' stderr +grep "^Makefile\\.am:1:.*${q}sub/foo${q}.*$badname" stderr +grep "^Makefile\\.am:1:.*sub/libfoo\\.a" stderr +grep "^foo\\.mk:5:.*${q}zardoz\\.a${q}.*$badname" stderr +grep "^foo\\.mk:5:.*libzardoz\\.a" stderr + +: -- 2.34.1