Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 98732 invoked from network); 4 Aug 2008 14:38:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Aug 2008 14:38:37 -0000 Received: (qmail 84336 invoked by uid 500); 4 Aug 2008 14:38:35 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 84316 invoked by uid 500); 4 Aug 2008 14:38:35 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 84305 invoked by uid 99); 4 Aug 2008 14:38:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2008 07:38:35 -0700 X-ASF-Spam-Status: No, hits=-8.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [195.135.220.2] (HELO mx1.suse.de) (195.135.220.2) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Aug 2008 14:37:36 +0000 Received: from Relay2.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 0F88D4179C for ; Mon, 4 Aug 2008 16:37:02 +0200 (CEST) Date: Mon, 4 Aug 2008 16:37:01 +0200 From: Peter Poeml To: modules-dev@httpd.apache.org Subject: Re: Testing modules using Python Message-ID: <20080804143701.GH12128@suse.de> Mail-Followup-To: modules-dev@httpd.apache.org References: <3CAFA8502A25A841B2F6D22237BFC01A01E86C84@exbe05.intra.dlr.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYo4Elh1vtcYNvbq" Content-Disposition: inline In-Reply-To: <3CAFA8502A25A841B2F6D22237BFC01A01E86C84@exbe05.intra.dlr.de> X-Useless-Header: If you read this, say 'honk'! User-Agent: Mutt/1.5.13 (2006-08-11) Sender: Peter Poeml X-Virus-Checked: Checked by ClamAV on apache.org --zYo4Elh1vtcYNvbq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 04, 2008 at 04:27:58PM +0200, Steven.Mohr@dlr.de wrote: > Hi, > I want to unit test my module (catacomb.tigris.org) using Python. My > idea is to load the module with ctypes (a python module that allows to > load functions from shared libraries into python) and test it in this > environment. The main advantage is that it's much easier to create > mock-up objects in Python than in C. My problem is that ctypes fails if > the shared library contains any undefined symbols. Because the module is > used normally together with a httpd server, > there're a lot of undefined symbols. My solution is to link libapr, > libaprutil, libexpat and libmysql statically in my module and to add a > file with the definitions of the apache-internal functions (just copy > and paste from httpd source). With every function which I copy in this > file I get a few new undefined symbols. All in all it's a pain to search > all definitions and I probably have to do this again after adding new > features which uses other functionalities.=20 >=20 > Is there an easier way to do this? To build a module which includes all > needed links to apache functions without linking the needed libraries > statically and copy-and-paste functions from apache source? Or do you > know a better way to do this? >=20 > Steven=20 With httpd 1.3, there used to be a way to build something what was called "shared core", a shared object that contained the server in a form you could link it into an application. I don't know if this is still possible with httpd 2.x, but what used I in an RPM package at the time was=20 --enable-rule=3DSHARED_CORE =20 mkdir shared_core cp -p src/libhttpd.ep src/libhttpd.so src/httpd shared_core # install shared-core apache install -m 755 shared_core/libhttpd.ep $RPM_BUILD_ROOT/%{_libdir}/%{name} install -m 755 shared_core/libhttpd.so $RPM_BUILD_ROOT/%{_libdir}/%{name} ln -s %{_libdir}/%{name}/libhttpd.ep $RPM_BUILD_ROOT/%{_sbindir}/httpd-s= hared_core ln -s %{_libdir}/%{name}/libhttpd.so $RPM_BUILD_ROOT/%{_libdir}/libhttpd= =2Eso At the time, that was reportedly working to build DSOs with Kylix 3. Peter --=20 Contact: admin@opensuse.org (a.k.a. ftpadmin@suse.com) #opensuse-mirrors on freenode.net Info: http://en.opensuse.org/Mirror_Infrastructure =20 SUSE LINUX Products GmbH Research & Development --zYo4Elh1vtcYNvbq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFIlxQN92K4Je+2lOoRAsNkAJ45igW0kK8l2tapO2y9ejIZYz7nhACeOvyy SbYhCFteeeqKky2ezQXoAZg= =yKsL -----END PGP SIGNATURE----- --zYo4Elh1vtcYNvbq--