Philippe M. Chiasson wrote:
this patch allow's mod_perl's Makefile.PL to detect if Apache::Test is installed and switch over to if for it's tests. It means apxs/dso builds can now make tests like everything else.

I suspect this would also kinda work under win32 (possibly with small tweaks).

If Apache::Test isn't found, it just tells the users about the goodness of Apache::Test
and reverts back to the old mechanism.

very nice ;)


May I suggest that if you write/rewrite big chunks of code we stick to a our style? We didn't care much about mp1 since it wasn't going to be changed, but since you change quite a lot, keeping newly added things nice is probably a good idea.

Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl/Makefile.PL,v
retrieving revision 1.216
diff -b -B -u -r1.216 Makefile.PL
--- Makefile.PL 19 Aug 2003 05:07:44 -0000 1.216
+++ Makefile.PL 22 Aug 2003 23:41:21 -0000
@@ -25,6 +25,15 @@
use Cwd;
use File::Copy qw(cp);
+#We need to check early
+eval {
+ require Apache::TestMM;
+ require Apache::TestRunPerl;

very smart! won't fall into the trick of loading Apache::test on case-insensitive OSs ;)


+};
+if(!$@) { + $APACHE_TEST++ +}
+

unless ($@) {


too much C coding? ;)

@@ -914,7 +923,7 @@
push @test_pre_init, "\t", '$(CP) t/conf/mod_perl_srm.conf t/conf/srm.conf', "\n";
}
- unless ($USE_APXS) {
+ unless ($USE_APXS && !$APACHE_TEST) {


unless (!) is mind boggling, how about:

if (!$USE_APXS || $APACHE_TEST)

+if ($APACHE_TEST) {
+    require File::Spec;
+
+    my @server;
+
+    my @documentroot = ('-documentroot', 
File::Spec->rel2abs(File::Spec->catdir(File::Spec->curdir, 't','docs')));
+    my @libmodperl = ('-libmodperl', 
File::Spec->rel2abs(File::Spec->catdir(File::Spec->curdir, 'apaci', 'libperl.so')));

this option was added in Apache::Test 1.01, so you probably need to check for the version as well.




+    if($USE_APXS) {
+        @server = ('-apxs', File::Spec->rel2abs($WITH_APXS));
+    }
+    else {
+        @server = ('-httpd', 
File::Spec->rel2abs(File::Spec->catfile($APACHE_SRC,$TARGET)));
+    }
+
+    local @ARGV = (@server, @documentroot, @libmodperl);
+
+    use Data::Dumper; print Dumper [EMAIL PROTECTED];

eh? remove?


+    Apache::TestMM::filter_args();
+    Apache::TestRunPerl->generate_script();
+}
+
 sub MY::dist_basics {
     my $self = shift;
     my $string = $self->MM::dist_basics;
@@ -1466,6 +1508,7 @@
     my $self = shift;
     my $test = $self->MM::test;
     my $mmn = magic_number($APACHE_SRC);
+    unless($APACHE_TEST) {
     return <<'EOF' if $USE_APXS and not $Is_dougm;

indent?


The rest looks cool


__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to