You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/03/27 21:57:00 UTC

svn commit: r523055 - in /incubator/qpid/trunk/qpid/cpp/tests: Makefile.am dlclose_noop.c run-unit-tests

Author: aconway
Date: Tue Mar 27 12:57:00 2007
New Revision: 523055

URL: http://svn.apache.org/viewvc?view=rev&rev=523055
Log:
Fix valgrind on unit tests: missing symbols for dynamically unloaded libs.
Interposed library supresses dlclose so symbols are reported.

Added:
    incubator/qpid/trunk/qpid/cpp/tests/dlclose_noop.c   (with props)
Modified:
    incubator/qpid/trunk/qpid/cpp/tests/Makefile.am
    incubator/qpid/trunk/qpid/cpp/tests/run-unit-tests

Modified: incubator/qpid/trunk/qpid/cpp/tests/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/Makefile.am?view=diff&rev=523055&r1=523054&r2=523055
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/Makefile.am Tue Mar 27 12:57:00 2007
@@ -89,6 +89,11 @@
 
 include gen.mk
 
+check_LTLIBRARIES += libdlclose_noop.la
+libdlclose_noop_la_LDFLAGS = -module -rpath /home/aconway/svn/qpid/cpp/tests
+libdlclose_noop_la_SOURCES = dlclose_noop.c
+
+
 abs_builddir = @abs_builddir@
 extra_libs = $(CPPUNIT_LIBS)
 lib_client = $(abs_builddir)/../lib/client/libqpidclient.la
@@ -113,6 +118,5 @@
 	)					\
 	> $@-t
 	mv $@-t $@
-
 
 check: $(check_LTLIBRARIES) $(lib_common) $(lib_client) $(lib_broker)

Added: incubator/qpid/trunk/qpid/cpp/tests/dlclose_noop.c
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/dlclose_noop.c?view=auto&rev=523055
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/dlclose_noop.c (added)
+++ incubator/qpid/trunk/qpid/cpp/tests/dlclose_noop.c Tue Mar 27 12:57:00 2007
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/*
+ * Loaded via LD_PRELOAD this will turn dlclose into a no-op.
+ *
+ * Allows valgrind to generate useful reports from programs that
+ * dynamically unload libraries before exit, such as CppUnit's
+ * DllPlugInTester.
+ *
+ */
+
+#include <stdio.h>
+void* dlclose(void* handle) {}
+

Propchange: incubator/qpid/trunk/qpid/cpp/tests/dlclose_noop.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/trunk/qpid/cpp/tests/dlclose_noop.c
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/qpid/trunk/qpid/cpp/tests/run-unit-tests
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/run-unit-tests?view=diff&rev=523055&r1=523054&r2=523055
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/run-unit-tests (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/run-unit-tests Tue Mar 27 12:57:00 2007
@@ -3,7 +3,7 @@
 . $srcdir/setup
 
 fail=0
-$vg DllPlugInTester -c -b $pwd/.libs/*.so 2> out || fail=1
-vg_check out || fail=1
+LD_PRELOAD=$pwd/.libs/libdlclose_noop.so $vg DllPlugInTester -c -b $pwd/.libs/*Test.so 2> valgrind.out || fail=1
+vg_check valgrind.out || fail=1
 
 exit $fail