Return-Path: Delivered-To: apmail-httpd-test-dev-archive@www.apache.org Received: (qmail 396 invoked from network); 21 Jan 2004 07:20:38 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 21 Jan 2004 07:20:38 -0000 Received: (qmail 25167 invoked by uid 500); 21 Jan 2004 07:20:10 -0000 Delivered-To: apmail-httpd-test-dev-archive@httpd.apache.org Received: (qmail 25117 invoked by uid 500); 21 Jan 2004 07:20:10 -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 25026 invoked from network); 21 Jan 2004 07:20:09 -0000 Received: from unknown (HELO mail.logilune.com) (195.154.174.52) by daedalus.apache.org with SMTP; 21 Jan 2004 07:20:09 -0000 Received: from stason.org (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 9288379C06 for ; Wed, 21 Jan 2004 08:20:19 +0100 (CET) Message-ID: <400E2832.9070005@stason.org> Date: Tue, 20 Jan 2004 23:20:18 -0800 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031010 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: test-dev@httpd.apache.org Subject: Re: Apache-Test and Cwd References: <3508775E-4BB7-11D8-8158-000A95972D84@kineticode.com> In-Reply-To: <3508775E-4BB7-11D8-8158-000A95972D84@kineticode.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 X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N David Wheeler wrote: > Hi All, > > A while ago, I enquired about the Cwd that Apache::Test uses, and asked > if something could be added to make it different. This is because a lot > of existing test modules (such as Test::POD) expect tests to be run from > the distribution package root. Apache::Test is fairly unique (outside of > Perl itself) in running tests from inside t/. Geoff and I have discussed > this problem in the past, and I know that Geoff and Stas have discussed > it, too, but wanted to get an update on where things stand on this. Does the patch below solve the problem? > Also, has Apache::Test been ported to work with Module::Build yet? > Module::Build doesn't use a Makefile, so I wouldn't expect > Apache::Test's magic to work with Module::Build, so I wasn't sure if > anyone had addressed this yet. Not yet. It should be trivial for someone who knows Module::Build, since all you need is to port two tiny 'test' and 'clean' MM targets from Apache/TestMM.pm. Patches are welcome. I'd suggest to call it Apache::TestMB. Index: lib/Apache/TestHarness.pm =================================================================== RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestHarness.pm,v retrieving revision 1.12 diff -u -r1.12 TestHarness.pm --- lib/Apache/TestHarness.pm 12 Sep 2003 02:20:27 -0000 1.12 +++ lib/Apache/TestHarness.pm 21 Jan 2004 07:15:32 -0000 @@ -10,12 +10,6 @@ use File::Find qw(finddepth); use File::Basename qw(dirname); -sub chdir_t { - chdir 't' if -d 't'; -#Apache::TestConfig->new takes care of @INC -# inc_fixup(); -} - sub inc_fixup { # use blib unshift @INC, map "blib/$_", qw(lib arch); @@ -101,14 +95,14 @@ my $args = shift; my @tests = (); - chdir_t(); + my $base = -d 't' ? catdir('t', '.') : '.'; my $ts = $args->{tests} || []; if (@$ts) { for (@$ts) { if (-d $_) { - push(@tests, sort <$_/*.t>); + push(@tests, sort <$base/$_/*.t>); } else { $_ .= ".t" unless /\.t$/; @@ -118,7 +112,7 @@ } else { if ($args->{tdirs}) { - push @tests, map { sort <$_/*.t> } @{ $args->{tdirs} }; + push @tests, map { sort <$base/$_/*.t> } @{ $args->{tdirs} }; } else { finddepth(sub { @@ -127,7 +121,7 @@ my $dotslash = catfile '.', ""; $t =~ s:^\Q$dotslash::; push @tests, $t - }, '.'); + }, $base); @tests = sort @tests; } } __________________________________________________________________ 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