Hi Peter, thanks for the feedback. On Tuesday 08 November 2011, Peter Rosin wrote: > Stefano Lattarini skrev 2011-11-03 15:15: > > * 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. > > Some of these changes are strictly speaking not new portability > _requirements_. > True, but I coulnd't resist to copying & pasting from your earlier ChangeLog entries :-(
> But if you indeed think these changes are important, > They are not really important; still, strictly speaking, they are an improvement in correctness (albeit very minor), so they're nice to have; most importantly, it has been *very easy* to determine a partial list of tests that could be improved in this regard: $ git co v1.11-547-g2270535 # Commit before my patch. $ grep -L AM_PROG_AR `grep -l AC_PROG_RANLIB tests/*.test` tests/alloca.test tests/ar2.test tests/discover.test tests/extra-portability2.test tests/libobj3.test tests/library2.test tests/parse.test tests/pluseq7.test tests/pr300-lib.test tests/pr401.test tests/pr401c.test tests/stdlib.test Otherwise I wouldn't have bothered. > you'd also want to fix e.g. alloca2.test > Done in the attached patch, for this and few other tests too. This time, the list of candidate tests has been kindly provided by the following improved grep search: $ grep -L AM_PROG_AR `grep -El '_(LT)?LIBRARIES' tests/*.test` tests/ar2.test tests/extra-portability2.test tests/ldadd.test tests/library2.test tests/library3.test tests/libtool4.test tests/pluseq7.test tests/pr211.test tests/pr300-lib.test tests/pr300-ltlib.test tests/pr307.test tests/pr401.test tests/pr401b.test tests/pr401c.test tests/pr72.test tests/reqd2.test tests/syntax.test > (quite possibly others as > well, but I have scanned through the tests too many times for > AM_PROG_AR issues to do it once more without good reason). > I agree that doing this "by hand" wouldn't be worthwhile (and that's why I've only checked the tests resulting from the grepping above). > I'm mostly curious why you have changed these tests, which had the > pattern "don't care if automake fails in one more way since I'm > greping for the error message anyway" and instead desire them to > keep quiet about extra-portability stuff. The changes seem really > pedantic IMHO. > They are quite pedantic; but they also have a real advantage IMHO (albeit admittedly very minor): future or more casual developers won't risk to be confused by the "spurious" errors, which would be just "accidental" rather than "deliberate" as the error whose message we are testing it. And anyway, when it comes to testing, I'm quite pedantic :-) Regards, Stefano
From 620ba14f54a994d3b695001546a4734282902bba Mon Sep 17 00:00:00 2001 Message-Id: <620ba14f54a994d3b695001546a4734282902bba.1320918977.git.stefano.lattar...@gmail.com> From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Thu, 10 Nov 2011 10:50:35 +0100 Subject: [FYI] {msvc} tests: various minor tweakings, mostly related to AM_PROG_AR * tests/alloca2.test: Ensure we don't experience a spurious failure due to a missing `AM_PROG_AR' macro or a missing `ar-lib' auxiliary script. * tests/libtool4.test: Likewise. * tests/ldadd.test: Likewise. Since we are at it, make grepping of automake stderr stricter. * tests/reqd2.test: Likewise. * tests/pr211.test: Ensure automake fails also with `-Wnone', since the error we are testing for is an hard error, not a mere warning. * tests/syntax.test: Likewise, and ensure we don't fail to other errors by removing use of `lib_LTLIBRARIES' in Makefile.am. Since we are at it, make grepping of automake stderr stricter. --- ChangeLog | 16 ++++++++++++++++ tests/alloca2.test | 4 +++- tests/ldadd.test | 7 ++++--- tests/libtool4.test | 5 ++++- tests/pr211.test | 2 +- tests/reqd2.test | 6 +++++- tests/syntax.test | 11 +++++++---- 7 files changed, 40 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a86113..2451f89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2011-11-10 Stefano Lattarini <stefano.lattar...@gmail.com> + + tests: various minor tweakings, mostly related to AM_PROG_AR + * tests/alloca2.test: Ensure we don't experience a spurious failure + due to a missing `AM_PROG_AR' macro or a missing `ar-lib' auxiliary + script. + * tests/libtool4.test: Likewise. + * tests/ldadd.test: Likewise. Since we are at it, make grepping of + automake stderr stricter. + * tests/reqd2.test: Likewise. + * tests/pr211.test: Ensure automake fails also with `-Wnone', since + the error we are testing for is an hard error, not a mere warning. + * tests/syntax.test: Likewise, and ensure we don't fail to other + errors by removing use of `lib_LTLIBRARIES' in Makefile.am. Since + we are at it, make grepping of automake stderr stricter. + 2011-11-05 Stefano Lattarini <stefano.lattar...@gmail.com> ar-lib: fix configure output for "unrecognized archiver interface" diff --git a/tests/alloca2.test b/tests/alloca2.test index caf11a3..a459338 100755 --- a/tests/alloca2.test +++ b/tests/alloca2.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 @@ -22,6 +22,7 @@ set -e cat >> configure.in <<'END' AC_PROG_CC +AM_PROG_AR END cat > Makefile.am << 'END' @@ -31,6 +32,7 @@ libtu_la_LIBADD = @LTALLOCA@ END : > alloca.c +: > ar-lib $ACLOCAL AUTOMAKE_fails diff --git a/tests/ldadd.test b/tests/ldadd.test index 7f4fce8..3515a4e 100755 --- a/tests/ldadd.test +++ b/tests/ldadd.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2010 Free Software +# Copyright (C) 1997, 1999, 2000, 2001, 2002, 2010, 2011 Free Software # Foundation, Inc. # # This program is free software; you can redistribute it and/or modify @@ -42,6 +42,7 @@ END : > q.c $ACLOCAL || Exit 1 -AUTOMAKE_fails -grep LDADD stderr || Exit 1 +AUTOMAKE_fails -Wno-extra-portability +grep "libtu_la_LDADD" stderr +grep " use [\`"']libtu_la_LIBADD' stderr Exit 0 diff --git a/tests/libtool4.test b/tests/libtool4.test index 9f6a730..814b537 100755 --- a/tests/libtool4.test +++ b/tests/libtool4.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 @@ -22,12 +22,15 @@ set -e cat >> configure.in <<'END' AC_PROG_CC +AM_PROG_AR END cat > Makefile.am << 'END' EXTRA_LTLIBRARIES = liblib.la END +: > ar-lib + $ACLOCAL AUTOMAKE_fails grep '[Ll]ibtool library .*LIBTOOL.* undefined' stderr diff --git a/tests/pr211.test b/tests/pr211.test index 6778f7a..798e4f6 100755 --- a/tests/pr211.test +++ b/tests/pr211.test @@ -47,7 +47,7 @@ END libtoolize $ACLOCAL -AUTOMAKE_fails -a +AUTOMAKE_fails -Wnone -a $FGREP 'foo.$(OBJEXT)' stderr : diff --git a/tests/reqd2.test b/tests/reqd2.test index b47ef15..1bf8123 100755 --- a/tests/reqd2.test +++ b/tests/reqd2.test @@ -29,6 +29,7 @@ AC_CONFIG_AUX_DIR([autoconf]) AM_INIT_AUTOMAKE AC_CONFIG_FILES([Makefile]) AC_PROG_CC +AM_PROG_AR AM_PROG_LIBTOOL AC_CONFIG_FILES([autoconf/Makefile main/Makefile]) AC_OUTPUT @@ -45,6 +46,7 @@ lib_LTLIBRARIES = lib0.la lib0_la_SOURCES = 0.c END +: > ar-lib libtoolize --force --copy $ACLOCAL $AUTOCONF @@ -52,4 +54,6 @@ $AUTOCONF test -f autoconf/ltmain.sh # Sanity check. rm -f autoconf/ltmain.sh AUTOMAKE_fails --add-missing --copy -grep 'autoconf/ltmain.sh' stderr +grep '^configure\.in:7:.* required file.*autoconf/ltmain\.sh' stderr + +: diff --git a/tests/syntax.test b/tests/syntax.test index 505486f..23fa792 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, 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 @@ -23,9 +24,11 @@ set -e cat > Makefile.am << 'END' foo = q \ -lib_LTLIBRARIES = foo.la +bin_SCRIPTS = foo.sh END $ACLOCAL -AUTOMAKE_fails -grep 'Makefile.am:2:.*blank line' stderr +AUTOMAKE_fails -Wnone +grep '^Makefile\.am:2:.*blank line following trailing backslash' stderr + +: -- 1.7.2.3