stas 2004/01/30 00:40:24
Modified: ModPerl-Registry/t TEST.PL Log: make the calculation of the location of src/modules/perl in the parent root independent of the cwd() Revision Changes Path 1.13 +6 -7 modperl-2.0/ModPerl-Registry/t/TEST.PL Index: TEST.PL =================================================================== RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/TEST.PL,v retrieving revision 1.12 retrieving revision 1.13 diff -u -u -r1.12 -r1.13 --- TEST.PL 28 Jan 2004 06:06:55 -0000 1.12 +++ TEST.PL 30 Jan 2004 08:40:24 -0000 1.13 @@ -18,8 +18,8 @@ # redirect tests require 2 servers use constant MIN_MAXCLIENTS => 2; -use Cwd (); -use File::Spec::Functions qw(splitpath splitdir catpath catdir rootdir); +use File::Spec::Functions qw(catdir); +use File::Basename qw(dirname); use Apache::Build; @@ -33,11 +33,10 @@ sub new_test_config { my $self = shift; - my ($volume, $dir, $file) = splitpath Cwd::cwd(), 1; - my @dir = grep {length} splitdir $dir; - $dir = catdir @dir[0..($#dir-2)]; # remove two last dir segments - my $base = catpath $volume, rootdir(), $dir, $file; - $self->{conf_opts}->{src_dir} = catdir $base, qw(src modules perl); + require Apache::Test; + my $mp2_root_dir = dirname Apache::Test::vars('top_dir'); + $self->{conf_opts}->{src_dir} = catdir $mp2_root_dir, + qw(src modules perl); $self->{conf_opts}->{startup_timeout} ||= DEFAULT_STARTUP_TIMEOUT;