Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@locus.apache.org Received: (qmail 60900 invoked from network); 7 Aug 2008 08:00:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Aug 2008 08:00:55 -0000 Received: (qmail 26143 invoked by uid 500); 7 Aug 2008 08:00:52 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 26118 invoked by uid 500); 7 Aug 2008 08:00:52 -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 26107 invoked by uid 99); 7 Aug 2008 08:00:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 01:00:52 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Steven.Mohr@dlr.de designates 195.37.61.185 as permitted sender) Received: from [195.37.61.185] (HELO smtp-4.dlr.de) (195.37.61.185) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 07:59:54 +0000 Received: from exbe05.intra.dlr.de ([192.168.35.38]) by smtp-4.dlr.de with Microsoft SMTPSVC(6.0.3790.1830); Thu, 7 Aug 2008 09:59:58 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: AW: Testing modules using Python Date: Thu, 7 Aug 2008 09:59:22 +0200 Message-ID: <3CAFA8502A25A841B2F6D22237BFC01A01E86F5B@exbe05.intra.dlr.de> In-Reply-To: <20080804143701.GH12128@suse.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Testing modules using Python Thread-Index: Acj2P8kNlWKaJiEnQumdhMBv7bgD9QCItexg References: <3CAFA8502A25A841B2F6D22237BFC01A01E86C84@exbe05.intra.dlr.de> <20080804143701.GH12128@suse.de> From: To: X-OriginalArrivalTime: 07 Aug 2008 07:59:58.0938 (UTC) FILETIME=[966F33A0:01C8F863] X-Virus-Checked: Checked by ClamAV on apache.org Thanks for your advice. But I think that there's nothing comparable in = Apache 2.x. I've wrote an email to dev@httpd.apache.org. Perhaps is = there a possibility I don't know about and one of the guys there could = help me. Do you have other ideas how I could solve my problem?? Steven -----Urspr=FCngliche Nachricht----- Von: Peter Poeml [mailto:poeml@suse.de]=20 Gesendet: Montag, 4. August 2008 16:37 An: modules-dev@httpd.apache.org Betreff: Re: Testing modules using Python 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-shared_core ln -s %{_libdir}/%{name}/libhttpd.so = $RPM_BUILD_ROOT/%{_libdir}/libhttpd.so 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