One of the cheapest (ahem) ways to catch a number of gnulib bugs is to create one tree with all modules and all tests in it. If it works, that is. So I started doing this manually, again. Here's some fallout on the way to make path/to/gnulib-tool --with-tests $l --dir=foo --megatest
work. Apologies in advance for this being a huge blob. 0) I used Autoconf-2.60 and CVS Automake. YMMV. (I'll denote spots where things may need to be handled differently with older versions.) 1) $destdir may not contain slashes: gnulib-tool does `mkdir "$destdir"' to create it, and `cd "$destdir"; $cmds; cd ..' to enter/exit. 2) Outside the gnulib directory, the addition of `-tests' modules fails, thus limiting actual test exposure somewhat. :-) 3) Not all instances of `build-aux' in ALL/tests/configure.ac are rewritten to `../build-aux'. The following patch fixes (1)-(3). OK to apply? More below... * gnulib-tool (Command-line option processing): Ensure that $destdir contains no slash. (func_get_tests_module): Make work outside the gnulib source directory. (func_create_testdir): Rewrite all occurrences of `build-aux'. Index: gnulib-tool =================================================================== RCS file: /cvsroot/gnulib/gnulib/gnulib-tool,v retrieving revision 1.113 diff -u -r1.113 gnulib-tool --- gnulib-tool 23 Jun 2006 19:27:17 -0000 1.113 +++ gnulib-tool 6 Jul 2006 20:39:45 -0000 @@ -431,6 +431,10 @@ do_changelog=false fi + case $destdir in + */*) func_fatal_error "argument to --dir may not contain slashes" ;; + esac + # Remove trailing slashes from the directory names. This is necessary for # m4base (to avoid an error in func_import) and optional for the others. sed_trimtrailingslashes='s,\([^/]\)//*$,\1,' @@ -595,7 +599,7 @@ func_get_tests_module () { # The naming convention for tests modules is hardwired: ${module}-tests. - if test -f modules/"$1"-tests; then + if (cd "$gnulib_dir" && test -f modules/"$1"-tests); then echo "$1"-tests fi } @@ -1611,17 +1616,13 @@ else echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" fi - if test "$auxdir" != "build-aux"; then - sed_replace_build_aux=' + sed_replace_build_aux=' :a /AC_CONFIG_FILES(.*:build-aux\/.*)/{ s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:../'"$auxdir"'/\2)| ba }' - sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'` - else - sed_replace_build_aux= - fi + sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'` # We don't have explicit ordering constraints between the various # autoconf snippets. It's cleanest to put those of the library before # those of the tests. 4) Documentation should not be copied into the source tree (bug in getdate module; I'm inferring from other modules here) or the gnulib-tool should 'mkdir doc' to avoid a cp failure. OK? * modules/getdate: Do not list doc/getdate.texi. Index: modules/getdate =================================================================== RCS file: /cvsroot/gnulib/gnulib/modules/getdate,v retrieving revision 1.13 diff -u -r1.13 getdate --- modules/getdate 12 May 2005 15:22:34 -0000 1.13 +++ modules/getdate 6 Jul 2006 20:18:43 -0000 @@ -2,7 +2,6 @@ Convert a date/time string to linear time. Files: -doc/getdate.texi lib/getdate.h lib/getdate.y m4/bison.m4 5) Autoconf's getloadavg (still) needs getloadavg.c, which it only finds if AC_CONFIG_LIBOBJ_DIR is set correctly. This patch is Autoconf 2.60 and CVS Automake only. I'm showing it for completeness. (Dunno, maybe we should add m4_ifndef([AC_CONFIG_LIBOBJ_DIR], [AC_DEFUN([AC_CONFIG_LIBOBJ_DIR])]) just so the configure.ac works with older Autoconf for all other modules at least?) Index: gnulib-tool =================================================================== RCS file: /cvsroot/gnulib/gnulib/gnulib-tool,v retrieving revision 1.113 diff -u -r1.113 gnulib-tool --- gnulib-tool 23 Jun 2006 19:27:17 -0000 1.113 +++ gnulib-tool 6 Jul 2006 20:39:45 -0000 @@ -1585,6 +1589,7 @@ (echo "# Process this file with autoconf to produce a configure script." echo "AC_INIT([dummy], [0])" echo "AC_CONFIG_AUX_DIR([../$auxdir])" + echo "AC_CONFIG_LIBOBJ_DIR([../lib])" echo "AM_INIT_AUTOMAKE" echo echo "AM_CONFIG_HEADER([config.h])" @@ -1666,6 +1667,7 @@ if test "$auxdir" != "."; then echo "AC_CONFIG_AUX_DIR([$auxdir])" fi + echo "AC_CONFIG_LIBOBJ_DIR([lib])" echo "AM_INIT_AUTOMAKE" echo echo "AM_CONFIG_HEADER([config.h])" 6) I'd like a megatest that does not test each individual module but just all of them (I may be patient, but not _that_ patient ;-). Also I'd like failed checks to make the thingy fail, and configure to use a cache file whenever possible (due to the fact that the tests/ directory uses a separate configure script, this is a large speedup). The patch needs more work (maybe a new command line argument?), but shows where this could go: it would make --megatest feasible enough to be used more regularly. (Note that gnulib-tool --with-tests --test `gnulib-tool --list` is not equivalent, as it does not take into account that some modules may not be used together.) Index: gnulib-tool =================================================================== RCS file: /cvsroot/gnulib/gnulib/gnulib-tool,v retrieving revision 1.113 diff -u -r1.113 gnulib-tool --- gnulib-tool 23 Jun 2006 19:27:17 -0000 1.113 +++ gnulib-tool 6 Jul 2006 20:39:45 -0000 @@ -1756,10 +1758,10 @@ megasubdirs= # First, all modules one by one. - for onemodule in $allmodules; do - func_create_testdir "$megatestdir/$onemodule" $onemodule - megasubdirs="${megasubdirs}$onemodule " - done + #for onemodule in $allmodules; do + # func_create_testdir "$megatestdir/$onemodule" $onemodule + # megasubdirs="${megasubdirs}$onemodule " + #done # Then, all modules all together. # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME. allmodules=`for m in $allmodules; do if test $m != fnmatch-posix; then echo $m; fi; done` @@ -1955,9 +1957,9 @@ cd "$destdir" mkdir build cd build - ../configure + ../configure -C make - make check + make check || exit 1 make distclean remaining=`find . -type f -print` if test -n "$remaining"; then @@ -1978,9 +1980,9 @@ cd "$destdir" mkdir build cd build - ../configure + ../configure -C make - make check + make check || exit 1 make distclean remaining=`find . -type f -print` if test -n "$remaining"; then 7) Annoying warning from automake in tests/ due to extra directory (I don't know what to do here): | Makefile.am:16: AM_GNU_GETTEXT used but `po' not in SUBDIRS 9) Autoconf-2.60's AC_CHECK_DECLS_ONCE has two semantic differences with the one from onceonly_2_57.m4: - it accepts only one argument (why BTW? This looks like a bug; I think it's been discussed here before, but don't remember the details): | autoreconf: running: aclocal -I m4 | configure.ac:252: warning: _AC_Check_Decl_strtoimax strtoumax is m4_require'd but not m4_defun'd | autoconf/general.m4:2586: AC_CHECK_DECLS_ONCE is expanded from... | m4/_inttypes_h.m4:16: gl_INTTYPES_H is expanded from... | configure.ac:252: the top level - it expands to nothing, i.e., it does not produce a valid shell list: | checking for struct stat.st_blocks... (cached) yes | ../../ALL/configure: line 20067: syntax error near unexpected token `fi' | ../../ALL/configure: line 20067: ` fi' This patch should fix the two issues. Note that since gl_PREREQ_GETPASS expands to nothing, there is little point in putting it in a shell conditional. (Maybe there is incentive to instead not use AC_CHECK_DECLS_ONCE?) I've seen more intermediate failures, but not been able to reproduce them consistently. * m4/_inttypes_h.m4 (gl_INTTYPES_H): Use AC_CHECK_DECLS_ONCE with only one argument. * m4/fileblocks.m4 (gl_FILEBLOCKS): AC_CHECK_DECLS_ONCE may expand to nothing, so add a shell command to avoid syntax error. * m4/getpass.m4 (gl_FUNC_GETPASS): Likewise. Index: m4/_inttypes_h.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/_inttypes_h.m4,v retrieving revision 1.3 diff -u -r1.3 _inttypes_h.m4 --- m4/_inttypes_h.m4 4 Jul 2006 06:37:10 -0000 1.3 +++ m4/_inttypes_h.m4 6 Jul 2006 20:18:43 -0000 @@ -12,5 +12,6 @@ if test $gl_cv_have_include_next = no; then gl_ABSOLUTE_HEADER([inttypes.h]) fi -AC_CHECK_DECLS_ONCE([strtoimax strtoumax])dnl +AC_CHECK_DECLS_ONCE([strtoimax])dnl +AC_CHECK_DECLS_ONCE([strtoumax])dnl ]) Index: m4/fileblocks.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/fileblocks.m4,v retrieving revision 1.3 diff -u -r1.3 fileblocks.m4 --- m4/fileblocks.m4 23 Sep 2005 04:15:13 -0000 1.3 +++ m4/fileblocks.m4 6 Jul 2006 20:18:43 -0000 @@ -9,6 +9,7 @@ AC_STRUCT_ST_BLOCKS dnl Note: AC_STRUCT_ST_BLOCKS does AC_LIBOBJ(fileblocks). if test $ac_cv_member_struct_stat_st_blocks = no; then + : gl_PREREQ_FILEBLOCKS fi ]) Index: m4/getpass.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/getpass.m4,v retrieving revision 1.12 diff -u -r1.12 getpass.m4 --- m4/getpass.m4 20 Apr 2006 22:28:34 -0000 1.12 +++ m4/getpass.m4 6 Jul 2006 20:26:00 -0000 @@ -12,6 +12,7 @@ AC_REPLACE_FUNCS(getpass) AC_CHECK_DECLS_ONCE(getpass) if test $ac_cv_func_getpass = no; then + : gl_PREREQ_GETPASS fi ]) 9) With all these, I still get two test failures: | - argp.25134 differ: char 557, line 20 | FAIL: test-argp-2.sh | cu got b9a9a617 | FAIL: test-crc 10) making the command work for l=--libtool ... in another mail. Cheers, Ralf