Return-Path: Delivered-To: apmail-httpd-test-dev-archive@httpd.apache.org Received: (qmail 18576 invoked by uid 500); 7 Feb 2003 22:48:54 -0000 Mailing-List: contact test-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: test-dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list test-dev@httpd.apache.org Received: (qmail 18565 invoked from network); 7 Feb 2003 22:48:54 -0000 Message-ID: <3E443785.10009@stason.org> Date: Sat, 08 Feb 2003 09:47:33 +1100 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: test-dev@httpd.apache.org Subject: Re: are perl-framework apache tests still used? References: <5.2.0.9.2.20030206233755.0362ee28@pop3.rowe-clan.net> <3E435A7D.9090708@stason.org> <20030207084526.GB9553@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Joe Orton wrote: > On Fri, Feb 07, 2003 at 06:04:29PM +1100, Stas Bekman wrote: > >>William A. Rowe, Jr. wrote: >> >>>AHHH... you are confusing apr/test (Ryan's ongoing efforts, even apart >> >>>from the apr group) which tests internal functions, with perl-testsuite, >> >>>which tests behavior of the server. >>> >>>If Joe's tests work - commit them :-) >> >>I don't have php installed. Preferrably, someone who can test them first, >>will commit them. Otherwise I can commit without testing, though they need >>some cleanup (use hardcoded / path separator is not crossplatform)... > > > OK - is there some easy way to make this portable? The only other places > I can find which use local files seem to be doing the same thing, > though: modules/cgi.t with $cgi_log and write_htaccess in modules/dir.t? There are many more tests in the modperl-2.0 repository. And there is also an extensive doc http://perl.apache.org/docs/general/testing/testing.html To make things portable in Perl you have to use File::Spec. use File::Spec::Functions qw(catfile); my $docroot = $vars->{documentroot}; my $fname = catfile $docroot, "php", "getlastmod.php"; Though of course you don't want to use catfile for generating URLs, because there are always Unix way and "/php/getlastmod.php" is correct. Finally, rather than using: printf "# debug: month is %s\n", $month; Apache::TestUtil imports t_debug(), so you just need to say: t_debug("month is $month"); But we want the verbosity mode to be automatically enabled and disabled from the command line, so we use another utility: t_cmp and we end up with: ok t_cmp($result, $month, "testing modification month"); when you run the test suite with -v: % t/TEST -v php/getlastmod you will get the verbose debug information, so you don't need to add any extra debugging statements. __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com