You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2002/05/14 17:50:44 UTC
cvs commit: modperl-2.0/ModPerl-Registry/t TEST.PL
stas 02/05/14 08:50:44
Modified: ModPerl-Registry/t TEST.PL
Log:
making 'make test' in sub-dirs working:
- @INC adjustments
- need to find the locally built mod_perl.so, to run the test
Revision Changes Path
1.4 +14 -1 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.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TEST.PL 13 Nov 2001 04:35:26 -0000 1.3
+++ TEST.PL 14 May 2002 15:50:44 -0000 1.4
@@ -3,13 +3,18 @@
use strict;
use warnings FATAL => 'all';
-use lib "../lib"; # test against the source lib for easier dev
use lib map {("../blib/$_", "../../blib/$_")} qw(lib arch);
+# test against the source lib for easier dev
+use lib map {("../$_", "../../$_")} qw(lib Apache-Test/lib);
use Apache::TestRunPerl ();
+# sub-class Apache::TestRunPerl
package MyTest;
+use Cwd ();
+use File::Spec::Functions qw(splitpath splitdir catpath catdir rootdir);
+
our @ISA = qw(Apache::TestRunPerl);
# subclass new_test_config to add some config vars which will be
@@ -17,7 +22,15 @@
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 = rootdir() . catpath $volume, $dir, $file;
+
$self->{conf_opts}->{maxclients} = 2;
+
+ $self->{conf_opts}->{src_dir} = catdir $base, qw(src modules perl);
+ # $self->{conf_opts}->{libmodperl} = "$cwd/../../src/modules/perl/mod_perl.so";
return $self->SUPER::new_test_config;
}