From: Akim Demaille Date: Wed, 1 Mar 2000 08:22:40 +0000 (+0000) Subject: Test suite: instead of using a full list of the AC macros and an X-Git-Tag: autoconf-2.50~1113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b72cac902a60e1d281cbe8b1cfeb5d48c4c072e;p=thirdparty%2Fautoconf.git Test suite: instead of using a full list of the AC macros and an AT macro with selects which are the AC macros to test, just produce the list of the AC macros we want to test. * tests/atspecific.m4 (TEST_MACRO): Removed. * tests/Makefile.am (EGREP_EXCLUDE): New variable, performing the selection TEST_MACRO used to do. (macros.m4): Use it. Use AT_TEST_MACRO, not TEST_MACRO. Check also AU macros. --- diff --git a/ChangeLog b/ChangeLog index 184a63cc9..ff293e092 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2000-03-01 Akim Demaille + + Test suite: instead of using a full list of the AC macros and an + AT macro with selects which are the AC macros to test, just + produce the list of the AC macros we want to test. + + * tests/atspecific.m4 (TEST_MACRO): Removed. + * tests/Makefile.am (EGREP_EXCLUDE): New variable, performing the + selection TEST_MACRO used to do. + (macros.m4): Use it. Use AT_TEST_MACRO, not TEST_MACRO. Check + also AU macros. + 2000-03-01 Akim Demaille * doc/autoconf.texi: Tune the use of quotes, add missing diff --git a/tests/Makefile.am b/tests/Makefile.am index 885f2b705..dbb186cf9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -40,10 +40,50 @@ testsuite: atgeneral.m4 atspecific.m4 suite.m4 macros.m4 $(SUITE) chmod +x $@-tmp mv $@-tmp $@ + + +# EGREP_EXCLUDE +# ------------- +# The test `syntax.m4' tries to run all the macros of Autoconf to check +# for syntax problems, etc. Not all the macros can be run without argument, +# and some are already tested elsewhere. EGREP_EXCLUDE must filter out +# the macros we don't want to test in syntax.m4. +# +# - AC_CHECK decls, files, funcs, members, types, headers +# Already performed in the semantical tests. +# - AC_CONFIG +# They fail when the source does not exist. +# - AC_INIT +# AC_INIT includes all the AC_INIT macros. Note that there is an +# infinite m4 recursion if AC_INIT it used twice. +# - AC_PROG_(CC|CXX|F77)_(GNU|WORKS) +# are used in AC_PROG_CC etc. +# - AC_PATH_PROGS? +# They produce `= val' because $1 is empty. +# - AC_TRY +# Used in many places. +# - _AC_ +# Internal macros are used elsewhere. +EGREP_EXCLUDE = egrep -v \ + -e '^AC_ARG_VAR$$' \ + -e '^AC_CHECK_(DECL|FILE|FUNC|HEADER|MEMBER|SIZEOF|TYPE)S?$$' \ + -e '^AC_CHECK_PROGS$$' \ + -e '^AC_CONFIG' \ + -e '^AC_INIT' \ + -e '^AC_LINKER_OPTION$$' \ + -e '^AC_LINK_FILES$$' \ + -e '^AC_LIST_MEMBER_OF$$' \ + -e '^AC_PATH_(TOOL|PROG)S?$$' \ + -e '^AC_PROG_(CC|CXX|F77)_(GNU|WORKS)$$' \ + -e '^AC_REPLACE_FUNCS$$' \ + -e '^AC_SEARCH_LIBS$$' \ + -e '^AC_TRY' \ + -e '_AC_' + macros.m4: $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 $(srcdir)/Makefile.am cat $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 | \ - sed -ne 's/^AC_DEFUN(\[*\([a-zA-Z0-9_]*\).*$$/\1/p' | \ - sort >defuns + sed -ne 's/^A[CU]_DEFUN(\[*\([a-zA-Z0-9_]*\).*$$/\1/p' | \ + sort | uniq | $(EGREP_EXCLUDE) >defuns # Get the list of macros that are required: there is little interest # in testing them since they will be run but the guy who requires # them. @@ -52,7 +92,7 @@ macros.m4: $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 $(srcdir)/Make sort | uniq >requires for macro in `cat defuns`; do \ if fgrep "$$macro" requires >/dev/null 2>&1; then :; else \ - echo "TEST_MACRO([$$macro])" >>$@-t; \ + echo "AT_TEST_MACRO([$$macro])" >>$@-t; \ fi; \ done rm defuns requires diff --git a/tests/Makefile.in b/tests/Makefile.in index 01218f84e..f4a22e616 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -73,6 +73,31 @@ EXTRA_DIST = atgeneral.m4 atspecific.m4 suite.m4 macros.m4 actest.m4 $(SUITE) PERL = perl +# EGREP_EXCLUDE +# ------------- +# The test `syntax.m4' tries to run all the macros of Autoconf to check +# for syntax problems, etc. Not all the macros can be run without argument, +# and some are already tested elsewhere. EGREP_EXCLUDE must filter out +# the macros we don't want to test in syntax.m4. +# +# - AC_CHECK decls, files, funcs, members, types, headers +# Already performed in the semantical tests. +# - AC_CONFIG +# They fail when the source does not exist. +# - AC_INIT +# AC_INIT includes all the AC_INIT macros. Note that there is an +# infinite m4 recursion if AC_INIT it used twice. +# - AC_PROG_(CC|CXX|F77)_(GNU|WORKS) +# are used in AC_PROG_CC etc. +# - AC_PATH_PROGS? +# They produce `= val' because $1 is empty. +# - AC_TRY +# Used in many places. +# - _AC_ +# Internal macros are used elsewhere. +EGREP_EXCLUDE = egrep -v -e '^AC_ARG_VAR$$' -e '^AC_CHECK_(DECL|FILE|FUNC|HEADER|MEMBER|SIZEOF|TYPE)S?$$' -e '^AC_CHECK_PROGS$$' -e '^AC_CONFIG' -e '^AC_INIT' -e '^AC_LINKER_OPTION$$' -e '^AC_LINK_FILES$$' -e '^AC_LIST_MEMBER_OF$$' -e '^AC_PATH_(TOOL|PROG)S?$$' -e '^AC_PROG_(CC|CXX|F77)_(GNU|WORKS)$$' -e '^AC_REPLACE_FUNCS$$' -e '^AC_SEARCH_LIBS$$' -e '^AC_TRY' -e '_AC_' + + CLEANFILES = debug-*.sh macro configure configure.in config.status config.cache config.log config.h.in config.h DISTCLEANFILES = atconfig testsuite @@ -201,8 +226,8 @@ testsuite: atgeneral.m4 atspecific.m4 suite.m4 macros.m4 $(SUITE) macros.m4: $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 $(srcdir)/Makefile.am cat $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 | \ - sed -ne 's/^AC_DEFUN(\[*\([a-zA-Z0-9_]*\).*$$/\1/p' | \ - sort >defuns + sed -ne 's/^A[CU]_DEFUN(\[*\([a-zA-Z0-9_]*\).*$$/\1/p' | \ + sort | uniq | $(EGREP_EXCLUDE) >defuns # Get the list of macros that are required: there is little interest # in testing them since they will be run but the guy who requires # them. @@ -211,7 +236,7 @@ macros.m4: $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 $(srcdir)/Make sort | uniq >requires for macro in `cat defuns`; do \ if fgrep "$$macro" requires >/dev/null 2>&1; then :; else \ - echo "TEST_MACRO([$$macro])" >>$@-t; \ + echo "AT_TEST_MACRO([$$macro])" >>$@-t; \ fi; \ done rm defuns requires diff --git a/tests/atspecific.m4 b/tests/atspecific.m4 index 9e01c74a1..02c4bf5f2 100644 --- a/tests/atspecific.m4 +++ b/tests/atspecific.m4 @@ -131,47 +131,6 @@ AT_CLEANUP(configure config.status config.log config.cache config.hin config.h e -# TEST_MACRO(NAME-OF-THE-MACRO) -# ----------------------------- -# Run AT_TEST_MACRO(NAME-OF-THE-MACRO) on selected macros only. -# There are macros which require arguments. We cannot run them without. -# Below are some macros directly used with other macros. It is -# therefore useless to test them several times. -# - AC_CHECK decls, files, funcs, members, types, headers -# Already performed in the semantical tests. -# - AC_CONFIG -# They fail when the source does not exist. -# - AC_INIT -# AC_INIT includes all the AC_INIT macros. Note that there is an -# infinite m4 recursion if AC_INIT it used twice. -# - AC_PROG_(CC|CXX|F77)_(GNU|WORKS) -# are used in AC_PROG_CC etc. -# - AC_PATH_PROGS? -# They produce `= val' because $1 is empty. -# - AC_TRY -# Used in many places. -# - _AC_ -# Internal macros are used elsewhere. -AT_DEFINE(TEST_MACRO, -[m4_match([$1], - [^AC_ARG_VAR$],, - [^AC_CHECK_\(DECL\|FILE\|FUNC\|HEADER\|MEMBER\|SIZEOF\|TYPE\)S?$],, - [^AC_CHECK_PROGS$],, - [^AC_CONFIG],, - [^AC_INIT],, - [^AC_LINKER_OPTION$],, - [^AC_LINK_FILES$],, - [^AC_LIST_MEMBER_OF$],, - [^AC_PATH_\(TOOL\|PROG\)S?$],, - [^AC_PROG_\(CC\|CXX\|F77\)_\(GNU\|WORKS\)$],, - [^AC_REPLACE_FUNCS$],, - [^AC_SEARCH_LIBS$],, - [^AC_TRY],, - [^_AC_],, - - [AT_TEST_MACRO([$1])])]) - - # AT_CHECK_DEFINES(CONTENT) # ------------------------- # Verify that config.h, once stripped is CONTENT.