From 5e83ef7e7b353e06dbfcd5b3645fd9e19461fbcc Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 9 Jan 2020 12:34:16 -0700 Subject: [PATCH] [Build-System] Add print_tests make target to output the list of tests being built including in modules --- Makefile.am | 5 +++++ build/modmake.rules.in | 3 ++- build/modmake.rulesam | 5 +++++ configure.ac | 2 ++ src/mod/Makefile.am | 6 +++--- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 61b2c609da..f94eabe669 100644 --- a/Makefile.am +++ b/Makefile.am @@ -547,6 +547,7 @@ $(switch_builddir)/modules.conf: src/mod/modules.inc: $(switch_builddir)/modules.conf @echo "OUR_MODULES=$(OUR_MODS)" > $(switch_builddir)/src/mod/modules.inc @echo "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" >> $(switch_builddir)/src/mod/modules.inc + @echo "OUR_TEST_MODULES=$(OUR_TEST_MODS)" >> $(switch_builddir)/src/mod/modules.inc @echo "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc @echo "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" >> $(switch_builddir)/src/mod/modules.inc @echo "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" >> $(switch_builddir)/src/mod/modules.inc @@ -848,6 +849,10 @@ modclean: $(switch_builddir)/modules.conf src/mod/modules.inc modwipe: rm -f $(modulesdir)/*.so $(modulesdir)/*.la $(modulesdir)/*.dll $(modulesdir)/*.dylib +print_tests: libfreeswitch.la $(switch_builddir)/modules.conf src/mod/modules.inc + @cd tests/unit && $(MAKE) $(AM_MAKEFLAGS) print_tests + @cd src/mod && $(MAKE) $(AM_MAKEFLAGS) print_tests + dox: cd docs && doxygen $(PWD)/docs/Doxygen.conf diff --git a/build/modmake.rules.in b/build/modmake.rules.in index 6ebcf7a6b3..dbce9bd48e 100644 --- a/build/modmake.rules.in +++ b/build/modmake.rules.in @@ -107,6 +107,7 @@ install-modules: all-modules depend_install local_install mod_install uninstall-modules: local_uninstall mod_uninstall distclean-modules: clean-modules local_distclean extraclean-modules: distclean local_extraclean +print_tests: Makefile: @if test ! -f $@; then \ @@ -270,4 +271,4 @@ $(switch_srcdir)/src/include/switch_xml.h: .PHONY: all clean depend install distclean extraclean \ all-modules clean-modules depend-modules install-modules distclean-modules extraclean-modules \ local_all local_clean local_depend local_install local_distclean local_extraclean \ - mod_clean mod_install mod_uninstall depend_install + mod_clean mod_install mod_uninstall depend_install print_tests diff --git a/build/modmake.rulesam b/build/modmake.rulesam index bffa0db4ac..5ccdf8b5c2 100644 --- a/build/modmake.rulesam +++ b/build/modmake.rulesam @@ -14,3 +14,8 @@ install-modules: install uninstall-modules: uninstall distclean-modules: distclean extraclean-modules: extraclean + +print_tests: + @set +e; \ + test -z "$(TESTS)" || for i in $(TESTS); do echo $(subdir)/$$i; done; + \ No newline at end of file diff --git a/configure.ac b/configure.ac index 2a24f5b450..34f0d18ad3 100644 --- a/configure.ac +++ b/configure.ac @@ -2065,6 +2065,7 @@ OUR_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp OUR_CLEAN_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )' OUR_INSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )' OUR_UNINSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )' +OUR_TEST_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-print_tests ; done )"; echo $$mods )' OUR_DISABLED_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )' OUR_DISABLED_CLEAN_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )' OUR_DISABLED_INSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )' @@ -2079,6 +2080,7 @@ AC_SUBST(CONF_MODULES) AC_SUBST(OUR_MODS) AC_SUBST(OUR_CLEAN_MODS) +AC_SUBST(OUR_TEST_MODS) AC_SUBST(OUR_INSTALL_MODS) AC_SUBST(OUR_UNINSTALL_MODS) AC_SUBST(OUR_DISABLED_MODS) diff --git a/src/mod/Makefile.am b/src/mod/Makefile.am index b4f3eb5b0a..2fb1409681 100644 --- a/src/mod/Makefile.am +++ b/src/mod/Makefile.am @@ -4,6 +4,7 @@ all: $(OUR_MODULES) clean: $(OUR_CLEAN_MODULES) $(OUR_DISABLED_CLEAN_MODULES) install: $(OUR_INSTALL_MODULES) uninstall: $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES) +print_tests: $(OUR_TEST_MODULES) mod_skypopen-all: mod_gsmopen-all mod_gsmopen-all: mod_spandsp-all @@ -11,7 +12,7 @@ mod_unimrcp-all: mod_sofia-all mod_rayo-all: mod_dingaling-all mod_ssml-all: mod_rayo-all -$(OUR_MODULES) $(OUR_CLEAN_MODULES) $(OUR_INSTALL_MODULES) $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_MODULES) $(OUR_DISABLED_CLEAN_MODULES) $(OUR_DISABLED_INSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES): +$(OUR_MODULES) $(OUR_CLEAN_MODULES) $(OUR_INSTALL_MODULES) $(OUR_UNINSTALL_MODULES) $(OUR_DISABLED_MODULES) $(OUR_DISABLED_CLEAN_MODULES) $(OUR_DISABLED_INSTALL_MODULES) $(OUR_DISABLED_UNINSTALL_MODULES) $(OUR_TEST_MODULES): @set fnord $$MAKEFLAGS; amf=$$2; \ target=`echo $@ | sed -e 's|^.*-||'`; \ modname=`echo $@ | sed -e 's|-.*||' | sed -e 's|^.*/||'`; \ @@ -33,8 +34,7 @@ $(OUR_MODULES) $(OUR_CLEAN_MODULES) $(OUR_INSTALL_MODULES) $(OUR_UNINSTALL_MODUL if test -z "$$target" ; then target="all" ; fi ; \ if ! test -f $$moddir/$$modname.c && ! test -f $$moddir/$$modname.cpp && test $$modname != "mod_com_g729" ; \ then echo ; echo "WARNING $$modname is not a valid FreeSWITCH module dir, skipping it..." ; else \ - echo ;\ - echo making $$target $$modname ;\ + if test "$$target" != "print_tests" ; then echo; echo making $$target $$modname ; fi;\ test -d "$$buildmoddir" || mkdir -p $$buildmoddir ; \ (if test -f "$$moddir/Makefile" ; then \ test -f "$$buildmoddir/Makefile" || cp $$moddir/Makefile $$buildmoddir/Makefile ; \