httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [patch] a cleaner make clean
Date Sun, 09 Sep 2001 15:21:37 GMT
On Sat, 8 Sep 2001, Doug MacEachern wrote:

> On Sat, 8 Sep 2001, Stas Bekman wrote:
>
> >
> > all autogenerated files should be cleaned.
>
> true.
>
> > +my @clean_conf = map { "t/conf/$_" }
> > +    qw(*.conf apache_test_config.pm ssl/ssl.conf);
>
> but we should really hook into calling 't/TEST -clean'
> via Apache::TestMM, so for example Makefile.PL's just need to:
> use Apache::TestMM qw(clean);

I don't think this will work via import() trick since you still want to
reach the thing in: $self->MM::clean(@_); and you cannot before you call
WriteMakefile.

> similar to how you can already to for 'test'.

Here is how I've approached it (stolen from mod_perl's Makefile.PL):

Index: Makefile.PL
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Makefile.PL,v
retrieving revision 1.5
diff -u -r1.5 Makefile.PL
--- Makefile.PL	2001/08/21 05:15:37	1.5
+++ Makefile.PL	2001/09/09 15:12:14
@@ -26,3 +26,10 @@
     VERSION => '0.01',
     clean => { FILES => "@scripts t/TEST" },
 );
+
+sub MY::clean {
+    my $self = shift;
+    my $string = $self->MM::clean(@_);
+    Apache::TestMM::add_dep(\$string, clean => 'test_clean');
+    $string;
+}
Index: Apache-Test/lib/Apache/TestMM.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm,v
retrieving revision 1.10
diff -u -r1.10 TestMM.pm
--- Apache-Test/lib/Apache/TestMM.pm	2001/08/12 19:22:29	1.10
+++ Apache-Test/lib/Apache/TestMM.pm	2001/09/09 15:12:14
@@ -21,6 +21,12 @@
     }
 }

+sub add_dep {
+    my($string, $targ, $add) = @_;
+    $$string =~ s/($targ\s+::)/$1 $add /;
+}
+
+
 sub test {

     my $env = Apache::TestConfig->passenv_makestr();


_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



Mime
View raw message