[gst-cvs] gstreamer: checks: check for enum types not class_ref'ed in gst_init() in ' make check'

Tim Mueller tpm at kemper.freedesktop.org
Tue May 12 13:52:57 PDT 2009


Module: gstreamer
Branch: master
Commit: 3ee5d985675a50f75f98b1d3fa90090d1a82881a
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=3ee5d985675a50f75f98b1d3fa90090d1a82881a

Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date:   Tue May 12 21:00:15 2009 +0100

checks: check for enum types not class_ref'ed in gst_init() in 'make check'

---

 Makefile.am |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 58ee3ed..20527a5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -101,7 +101,25 @@ win32-update:
 	cp $(top_builddir)/win32/common/config.h-new \
 		$(top_srcdir)/win32/common/config.h
 
+check-enum-gettypes: $(top_builddir)/gst/gstenumtypes.h
+	echo 'Checking if all enum and flag _get_type() funcs are inited in gst_init()';                         \
+	FUNCS=`grep '_get_type (' gst/gstenumtypes.h | sed -e 's/^.*gst_/gst_/' -e 's/_get_type.*$$/_get_type/'`;\
+	MISSING_FUNCS='';                                                                                        \
+	for f in $$FUNCS; do                                                                                     \
+	  INIT_LINE=`grep $$f gst/*.c | grep g_type_class_ref`;                                                  \
+	  if test "x$$INIT_LINE" = "x"; then                                                                     \
+	    MISSING_FUNCS="$$MISSING_FUNCS $$f";                                                                 \
+	  fi;                                                                                                    \
+	done;                                                                                                    \
+	if test "x$$MISSING_FUNCS" != "x"; then                                                                  \
+	  echo "FIXME: please add to the following to gst/gst.c init_post():";                                   \
+	  for f in $$MISSING_FUNCS; do                                                                           \
+	    echo "  g_type_class_ref ($$f ());";                                                                 \
+	  done;                                                                                                  \
+	  exit 1;                                                                                                \
+	fi
+
 include $(top_srcdir)/common/coverage/lcov.mak
 
-check: check-exports
+check: check-exports check-enum-gettypes
 





More information about the Gstreamer-commits mailing list