* Ralf Wildenhues wrote on Thu, Nov 09, 2006 at 12:12:27AM CET: > It would be nice if > gnulib-tool --with-tests --test > > succeeded out of the box, including actually running the tests.
The patch below should some of the reported issues. OK to apply? FWIW, I still don't understand the necessity of a separate configure script in the gltests/ subdirectory at all. Is that just for testing purposes? Cheers, Ralf 2006-11-10 Ralf Wildenhues <[EMAIL PROTECTED]> * gnulib-tool (func_create_testdir): Fix gl_source_base setting. Fix replacement of `build-aux' in configure.ac. Run autotools in gltests subdirectory. (func_create_testdir, func_create_megatestdir, test): There is no need for '--force' in most autotool invocations in a new tree. Actually fail the whole test if any of the tools, or the configure or make stages fail. Index: gnulib-tool =================================================================== RCS file: /cvsroot/gnulib/gnulib/gnulib-tool,v retrieving revision 1.188 diff -u -r1.188 gnulib-tool --- gnulib-tool 6 Nov 2006 13:04:37 -0000 1.188 +++ gnulib-tool 10 Nov 2006 17:38:45 -0000 @@ -2284,7 +2284,7 @@ echo "gl_libdeps=" echo "gl_ltlibdeps=" fi - echo "gl_source_base='$testsbase'" + echo "gl_source_base='../$sourcebase'" # Wrap the set of autoconf snippets into an autoconf macro that is then # invoked. This is needed because autoconf does not support AC_REQUIRE # at the top level: @@ -2294,17 +2294,13 @@ # expansion total). echo "AC_DEFUN([gl_INIT], [" func_emit_initmacro_start - if test "$auxdir" != "build-aux"; then - 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=' + :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/^ *//'` # 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. @@ -2463,33 +2459,57 @@ # autopoint, which brings in older versions of some of our .m4 files. if test -f $m4base/gettext.m4; then echo "executing ${AUTOPOINT} --force" - ${AUTOPOINT} --force + ${AUTOPOINT} --force || func_exit 1 for f in $m4base/*.m4~; do - mv $f `echo $f | sed -e 's,~$,,'` + mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 done fi - echo "executing ${ACLOCAL} --force -I $m4base" - ${ACLOCAL} --force -I $m4base + echo "executing ${ACLOCAL} -I $m4base" + ${ACLOCAL} -I $m4base || func_exit 1 if ! test -d build-aux; then echo "executing mkdir build-aux" - mkdir build-aux + mkdir build-aux || func_exit 1 fi - echo "executing ${AUTOCONF} --force" - ${AUTOCONF} --force - echo "executing ${AUTOHEADER} --force" - ${AUTOHEADER} --force - echo "executing ${AUTOMAKE} --add-missing --copy --force-missing" - ${AUTOMAKE} --add-missing --copy --force-missing - ) + echo "executing ${AUTOCONF}" + ${AUTOCONF} || func_exit 1 + echo "executing ${AUTOHEADER}" + ${AUTOHEADER} || func_exit 1 + echo "executing ${AUTOMAKE} --add-missing --copy" + ${AUTOMAKE} --add-missing --copy || func_exit 1 + ) || func_exit 1 + # Create autogenerated files. + (cd "$testdir/$testsbase" || func_exit 1 + # Do not use "${AUTORECONF} --force --install", because it may invoke + # autopoint, which brings in older versions of some of our .m4 files. + if test -f ../$m4base/gettext.m4; then + echo "executing ${AUTOPOINT} --force" + ${AUTOPOINT} --force || func_exit 1 + for f in ../$m4base/*.m4~; do + mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 + done + fi + echo "executing ${ACLOCAL} -I ../$m4base" + ${ACLOCAL} -I ../$m4base || func_exit 1 + if ! test -d ../build-aux; then + echo "executing mkdir ../build-aux" + mkdir ../build-aux + fi + echo "executing ${AUTOCONF}" + ${AUTOCONF} || func_exit 1 + echo "executing ${AUTOHEADER}" + ${AUTOHEADER} || func_exit 1 + echo "executing ${AUTOMAKE} --add-missing --copy" + ${AUTOMAKE} --add-missing --copy || func_exit 1 + ) || func_exit 1 if grep '^BUILT_SOURCES *+=' "$testdir/$sourcebase/Makefile.am" > /dev/null; then (cd "$testdir" - ./configure + ./configure || func_exit 1 cd "$sourcebase" echo 'built_sources: $(BUILT_SOURCES)' >> Makefile - make built_sources + make built_sources || func_exit 1 cd .. - make distclean - ) + make distclean || func_exit 1 + ) || func_exit 1 fi } @@ -2546,14 +2566,14 @@ # recursively, but the subdirectories are already finished, therefore # calling autoreconf here would only waste lots of CPU time. echo "executing ${ACLOCAL}" - ${ACLOCAL} + ${ACLOCAL} || func_exit 1 echo "executing mkdir build-aux" mkdir build-aux echo "executing ${AUTOCONF}" - ${AUTOCONF} + ${AUTOCONF} || func_exit 1 echo "executing ${AUTOMAKE} --add-missing --copy" - ${AUTOMAKE} --add-missing --copy - ) + ${AUTOMAKE} --add-missing --copy || func_exit 1 + ) || func_exit 1 } case $mode in @@ -2722,10 +2742,10 @@ cd "$destdir" mkdir build cd build - ../configure - make - make check - make distclean + ../configure || func_exit 1 + make || func_exit 1 + make check || func_exit 1 + make distclean || func_exit 1 remaining=`find . -type f -print` if test -n "$remaining"; then echo "Remaining files:" $remaining 1>&2