X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gnulib-tool;h=407a96f92fe8e98b26649751893dd8a5c4c5e45c;hb=3da5573ddf12b4c4cc56ae305b0a044272673754;hp=64878a0eebdb057f6758fca454942e51b3c86077;hpb=5f20e745297e37686b60abda860fbe2a3d6c68c1;p=gnulib.git diff --git a/gnulib-tool b/gnulib-tool index 64878a0ee..407a96f92 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -2976,11 +2976,20 @@ func_emit_tests_Makefile_am () } > "$tmp"/amsnippet # Skip the contents if it's entirely empty. if grep '[^ ]' "$tmp"/amsnippet > /dev/null ; then - echo "## begin gnulib module $module" - echo - cat "$tmp"/amsnippet - echo "## end gnulib module $module" - echo + # Mention long-running tests at the end. + ofd=3 + for word in `func_get_status "$module"`; do + if test "$word" = 'longrunning-test'; then + ofd=4 + break + fi + done + { echo "## begin gnulib module $module" + echo + cat "$tmp"/amsnippet + echo "## end gnulib module $module" + echo + } >&$ofd fi rm -f "$tmp"/amsnippet # Test whether there are some source files in subdirectories. @@ -2994,7 +3003,7 @@ func_emit_tests_Makefile_am () done fi done - } > "$tmp"/allsnippets + } 3> "$tmp"/main_snippets 4> "$tmp"/longrunning_snippets # Generate dependencies here, since it eases the debugging of test failures. # If there are source files in subdirectories, prevent collision of the # object files (example: hash.c and libxml/hash.c). @@ -3011,7 +3020,7 @@ func_emit_tests_Makefile_am () # Nothing is being added to SUBDIRS; nevertheless the existence of this # variable is needed to avoid an error from automake: # "AM_GNU_GETTEXT used but SUBDIRS not defined" - echo "SUBDIRS =" + echo "SUBDIRS = ." echo "TESTS =" echo "XFAIL_TESTS =" echo "TESTS_ENVIRONMENT =" @@ -3030,7 +3039,7 @@ func_emit_tests_Makefile_am () fi # Automake versions < 1.9b create an empty pkgdatadir at installation time # if you specify pkgdata_DATA to empty. This is a workaround. - if grep '^pkgdata_DATA *+=' "$tmp"/allsnippets > /dev/null; then + if grep '^pkgdata_DATA *+=' "$tmp"/main_snippets "$tmp"/longrunning_snippets > /dev/null; then echo "pkgdata_DATA =" fi echo "EXTRA_DIST =" @@ -3096,7 +3105,7 @@ func_emit_tests_Makefile_am () # srcdir is defined by autoconf and automake. echo "TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='\$(srcdir)'" echo - cat "$tmp"/allsnippets \ + cat "$tmp"/main_snippets "$tmp"/longrunning_snippets \ | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g' echo "# Clean up after Solaris cc." echo "clean-local:" @@ -3109,7 +3118,7 @@ func_emit_tests_Makefile_am () echo " fi; \\" echo " done; \\" echo " :" - rm -f "$tmp"/allsnippets + rm -f "$tmp"/main_snippets "$tmp"/longrunning_snippets } # func_emit_initmacro_start macro_prefix @@ -5122,13 +5131,13 @@ func_create_testdir () fi # Need to run configure and make once, to create built files that are to be # distributed (such as getdate.c). + sed_remove_make_variables='s,[$]([A-Za-z0-9_]*),,g' # Extract the value of "CLEANFILES += ..." and "MOSTLYCLEANFILES += ...". cleaned_files=`sed -e "$sed_remove_backslash_newline" < "$testdir/$sourcebase/Makefile.am" \ | sed -n -e 's,^CLEANFILES[ ]*+=\([^#]*\).*$,\1,p' -e 's,^MOSTLYCLEANFILES[ ]*+=\([^#]*\).*$,\1,p'` cleaned_files=`for file in $cleaned_files; do echo " $file "; done` # Extract the value of "BUILT_SOURCES += ...". Remove variable references # such $(FOO_H) because they don't refer to distributed files. - sed_remove_make_variables='s,[$]([A-Za-z0-9_]*),,g' built_sources=`sed -e "$sed_remove_backslash_newline" < "$testdir/$sourcebase/Makefile.am" \ | sed -n -e 's,^BUILT_SOURCES[ ]*+=\([^#]*\).*$,\1,p' \ | sed -e "$sed_remove_make_variables"` @@ -5138,16 +5147,44 @@ func_create_testdir () *) echo $file ;; esac; done` - if test -n "$distributed_built_sources"; then + tests_distributed_built_sources= + if test -n "$inctests"; then + # Likewise for built files in the $testsbase directory. + tests_cleaned_files=`sed -e "$sed_remove_backslash_newline" < "$testdir/$testsbase/Makefile.am" \ + | sed -n -e 's,^CLEANFILES[ ]*+=\([^#]*\).*$,\1,p' -e 's,^MOSTLYCLEANFILES[ ]*+=\([^#]*\).*$,\1,p'` + tests_cleaned_files=`for file in $tests_cleaned_files; do echo " $file "; done` + tests_built_sources=`sed -e "$sed_remove_backslash_newline" < "$testdir/$testsbase/Makefile.am" \ + | sed -n -e 's,^BUILT_SOURCES[ ]*+=\([^#]*\).*$,\1,p' \ + | sed -e "$sed_remove_make_variables"` + tests_distributed_built_sources=`for file in $tests_built_sources; do + case "$tests_cleaned_files" in + *" "$file" "*) ;; + *) echo $file ;; + esac; + done` + fi + if test -n "$distributed_built_sources" || test -n "$tests_distributed_built_sources"; then (cd "$testdir" ./configure || func_exit 1 - cd "$sourcebase" - echo 'built_sources: $(BUILT_SOURCES)' >> Makefile - $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ - built_sources \ - || func_exit 1 - cd .. - $MAKE distclean || func_exit 1 + if test -n "$distributed_built_sources"; then + cd "$sourcebase" + echo 'built_sources: $(BUILT_SOURCES)' >> Makefile + $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ + built_sources \ + || func_exit 1 + cd .. + fi + if test -n "$tests_distributed_built_sources"; then + cd "$testsbase" + echo 'built_sources: $(BUILT_SOURCES)' >> Makefile + $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ + built_sources \ + || func_exit 1 + cd .. + fi + $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ + distclean \ + || func_exit 1 ) || func_exit 1 fi }