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 2003/01/06 11:39:44 UTC
cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin require.pl
stas 2003/01/06 02:39:44
Modified: ModPerl-Registry/t basic.t
ModPerl-Registry/t/cgi-bin require.pl
Log:
For now dynamically figure out the current dir and use the full path to
the require()
Revision Changes Path
1.8 +10 -13 modperl-2.0/ModPerl-Registry/t/basic.t
Index: basic.t
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/basic.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- basic.t 15 Aug 2002 16:17:52 -0000 1.7
+++ basic.t 6 Jan 2003 10:39:43 -0000 1.8
@@ -5,7 +5,6 @@
use Apache::TestUtil;
use Apache::TestRequest qw(GET_BODY HEAD);
-
my %modules = (
registry => 'ModPerl::Registry',
registry_bb => 'ModPerl::RegistryBB',
@@ -14,7 +13,7 @@
my @aliases = sort keys %modules;
-plan tests => @aliases * 3 + 1;
+plan tests => @aliases * 4 + 1;
# very basic compilation/response test
for my $alias (@aliases) {
@@ -49,18 +48,16 @@
);
}
-# XXX: chdir is not safe yet!
+# require (actually chdir test)
+for my $alias (@aliases) {
+ my $url = "/$alias/require.pl";
-## require (actually chdir test)
-#for my $alias (@aliases) {
-# my $url = "/$alias/require.pl";
-
-# ok t_cmp(
-# "it works",
-# GET_BODY($url),
-# "$modules{$alias} mod_cgi-like environment pre-set",
-# );
-#}
+ ok t_cmp(
+ "it works",
+ GET_BODY($url),
+ "$modules{$alias} mod_cgi-like environment pre-set",
+ );
+}
# test method handlers
{
1.4 +10 -6 modperl-2.0/ModPerl-Registry/t/cgi-bin/require.pl
Index: require.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/require.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- require.pl 16 Aug 2002 10:11:39 -0000 1.3
+++ require.pl 6 Jan 2003 10:39:44 -0000 1.4
@@ -1,11 +1,15 @@
# test the require
+use Apache::Test ();
+use File::Spec::Functions qw(catfile);
+
+my $vars = Apache::Test::config()->{vars};
+my $require = catfile $vars->{serverroot}, 'cgi-bin', 'local-conf.pl';
+
print "Content-type: text/plain\n\n";
-# XXX: fixme!
-#use lib qw(.);
-#my $file = "./local-conf.pl";
-#require $file;
+# XXX: meanwhile we don't chdir to the script's dir
+require $require;
+
+print defined $test_require && $test_require;
-#print defined $test_require && $test_require;
-print "it works";