gjs r62 - in trunk: . test



Author: tko
Date: Tue Oct 28 13:59:51 2008
New Revision: 62
URL: http://svn.gnome.org/viewvc/gjs?rev=62&view=rev

Log:
add target for running test programs in valgrind

	* Makefile-test.am (valgrind-check): add target for running test
	programs in valgrind and report memory leaks
	* test/gjs.supp: valgrind suppressions (for Ubuntu) to prevent
	known (and unavoidable?) leaks from failing the test

Added:
   trunk/test/gjs.supp
Modified:
   trunk/Makefile-test.am

Modified: trunk/Makefile-test.am
==============================================================================
--- trunk/Makefile-test.am	(original)
+++ trunk/Makefile-test.am	Tue Oct 28 13:59:51 2008
@@ -71,6 +71,26 @@
 
 check:	test
 
+valgrind-check valgrind-test: $(gjsnative_LTLIBRARIES) ${TEST_PROGS}
+	@test -z "${TEST_PROGS}" || { \
+	  failed=; for prog in ${TEST_PROGS}; do \
+	    ${TESTS_ENVIRONMENT} G_SLICE=always-malloc	\
+	    $(LIBTOOL) --mode=execute valgrind 		\
+	    --log-file=valgrind.$$prog.log 		\
+	    --error-exitcode=1 				\
+	    --trace-children=yes 			\
+	    --tool=memcheck 				\
+	    --leak-check=full 				\
+	    --suppressions=$(top_srcdir)/test/gjs.supp	\
+	    $$prog \
+	    && $(GREP) -q 'definitely lost: 0 bytes in 0 blocks' valgrind.$$prog.log \
+	    || failed="$$failed $$prog"; \
+	  done; \
+	  test -z "$$failed" || { \
+	    echo "valgrind failed for:$$failed"; exit 1; \
+	  }; \
+	}
+CLEANFILES += $(TEST_PROGS:%=valgrind.%.log)
 
 EXTRA_DIST +=					\
 	test/js/modules/jsUnit.js		\

Added: trunk/test/gjs.supp
==============================================================================
--- (empty file)
+++ trunk/test/gjs.supp	Tue Oct 28 13:59:51 2008
@@ -0,0 +1,58 @@
+{
+   gjs-unit test filenames never freed
+   Memcheck:Leak
+   fun:realloc
+   fun:g_realloc
+   obj:/usr/lib/libglib-2.0.so.0.*.*
+   fun:g_string_insert_len
+   fun:g_string_append_len
+   obj:/usr/lib/libglib-2.0.so.0.*.*
+   fun:g_build_filename
+   fun:main
+}
+
+{
+   g_type_init_with_debug_flags never freed
+   Memcheck:Leak
+   fun:calloc
+   fun:g_malloc0
+   obj:/usr/lib/libgobject-2.0.so.0.*.*
+   obj:/usr/lib/libgobject-2.0.so.0.*.*
+   fun:g_type_init_with_debug_flags
+   fun:g_type_init
+   fun:main
+}
+
+{
+   importer_new_resolve string never freed
+   Memcheck:Leak
+   fun:malloc
+   fun:g_malloc
+   fun:g_utf16_to_utf8
+   fun:gjs_string_to_utf8
+   fun:importer_new_resolve
+   obj:/usr/lib/xulrunner*/libmozjs.so
+   obj:/usr/lib/xulrunner*/libmozjs.so
+   obj:/usr/lib/xulrunner*/libmozjs.so
+   obj:/usr/lib/xulrunner*/libmozjs.so
+   fun:JS_EvaluateUCScriptForPrincipals
+   fun:JS_EvaluateUCScript
+   fun:JS_EvaluateScript
+}
+
+{
+   xulrunner internal allocations never freed
+   Memcheck:Leak
+   fun:malloc
+   obj:/usr/lib/xulrunner*/libmozjs.so
+   obj:/usr/lib/xulrunner*/libmozjs.so
+   obj:/usr/lib/xulrunner*/libmozjs.so
+   fun:gjs_context_constructor
+   fun:g_object_newv
+   fun:g_object_new_valist
+   fun:g_object_new
+   fun:gjs_context_new_with_search_path
+   fun:setup
+   obj:/usr/lib/libglib-2.0.so.0.*.*
+   obj:/usr/lib/libglib-2.0.so.0.*.*
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]