testing modules under apache
hiya recently here at work ive been asked to start providing test scripts for my projects perl modules ive found that its kinda hard to figure out which way to testcertain paradigms i was wondering what sort of help/tips/tricks anyone out there in modperl land could help me with here is the root of my problem i have one modules for my project called *::Global now this module contains any subs that can be reused by the rest of my project as well as some constants and routines for calling in support tables relted to categories etc i did a use case test script on my *::ViewMember and it reches out for *::Global's constant called *::Global::MEMBER_COLUMNS now i usually load *::Global into the Apache startup.pl so it is instanced under Apache but of course in testing under the test harness this will fail! =-=-=--= ive noticed a couple of things that might help one is Apache::FakeRequest as well there is the way Apache::AuthCookie tests: by starting up an httpd server inside of its test directory id rather not do that as it could get messy fast so if anyone could give me any tips at all ifd be most appreciative thanks!
Re: testing modules under apache
clayton cottingham wrote: [the gist of the clayton's request: The code needs to be tested under live httpd with mod_perl. How? ] Apache-Test framework developed for mod_perl 2.0 is *exactly* what you want. See how httpd-2.0 uses it (http://httpd.apache.org/test/ look for 'Perl Framework'). Grab the httpd-test sources (cvs from the above URL) and it's all there under perl-framework/. The module was primary developed for 2.x but should work for 1.x as well. I think that the only requirement is perl 5.6.x. I've started to write some basic guide for Apache-Test which you can find in the modperl-docs repository (currently only in .pod form): src/devel/writing_tests/writing_tests.pod You can grab the docs rep from http://cvs.apache.org/snapshots/modperl-docs/ (or via cvs) Feel free to contribute back extensions for this doc... _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/