Return-Path: Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 53712 invoked by uid 500); 6 May 2003 11:14:36 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 53680 invoked from network); 6 May 2003 11:14:35 -0000 Received: from moya.tamu.edu (128.194.103.45) by daedalus.apache.org with SMTP; 6 May 2003 11:14:35 -0000 Received: from moya.tamu.edu (jgsmith@localhost [127.0.0.1]) by moya.tamu.edu (8.12.8/8.12.8) with ESMTP id h46BEY2b019453; Tue, 6 May 2003 06:14:34 -0500 (CDT) Message-Id: <200305061114.h46BEY2b019453@moya.tamu.edu> From: James G Smith To: Stas Bekman cc: dev@perl.apache.org, httpd-test-dev list , david@wheeler.net Subject: Re: resolving Apache::Test vs. Apache::test collision Reply-To: JGSmith@TAMU.Edu X-Office: 326A Teague X-Organization: TAMU CIS Operating Systems Group, Unix X-Pgp-Key: Get key 0x7991CC92 by sending message with subject: "get pgp key" X-Url: http://HeX.TAMU.Edu/ X-Reposting-Policy: redistribute only with permission In-reply-to: Your message of "Tue, 06 May 2003 10:01:00 +1000." <3EB6FB3C.2010209@stason.org> Date: Tue, 06 May 2003 06:14:34 -0500 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Stas Bekman wrote: >We have a problem with using the Apache::Test name, more correctly we have a >problem with using the Apache/Test.pm filename. On platforms with >case-insentive filesystems (winFU, Mac OS X) if mod_perl 1.x is installed, >there is Apache/test.pm (notice the lower case 't'). So when you say 'use >Apache::Test' it loads Apache::test. Boom, nothing works. > >There are several routes we can take to resolve this problem: > >1. rename Apache::Test to something else. David Wheeler has proposed to use >Apache::Tester (or even swap the sides: Test::Apache). As much work as it would require at this point (going through and changing all the package names, renaming files, munging CVS), I think Test::Apache would fit in better. What convinced me of this was a look at my test code. At the top, ignoring the code to test for availability, I basically have (under the new name): use Test::Apache qw(plan have ok skip); use Test::Apache::Request qw(GET); plan tests => $some_number, have 'LWP'; # rest of tests here __END__ In my non-Apache modules, I have: use Test::More; plan tests => $some_number; # rest of tests here __END__ There's a nice symmetry here. Of course, I had to go and try combining the two :) They seem to work. I am able to use Test::More to plan and report testing while I use Apache::TestRequest to do the fetching. This undercuts a little the argument for Test::Apache being the better name. We still need the Apache::TestRequest version of GET because it knows where the test server is. use Test::More; BEGIN { eval { require Apache::TestRequest; Apache::TestRequest -> import(qw(GET)); }; } my @required = qw( Apache::Test Apache::TestRequest DBD::CSV HTML::Mason LWP ); my @unavailable; if(@unavailable = grep { ! eval "require $_" } @required) { plan skip_all => "The following modules are unavailable: " . join(" ", @unavailable); exit 0; } plan tests => 1; my $res = GET "/mason/test1.html"; ok $res->content eq '[This is a Mason Page] '; exit 0; __END__ -- James Smith , 979-862-3725 Texas A&M CIS Operating Systems Group, Unix --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org For additional commands, e-mail: dev-help@perl.apache.org