On Oct 5, 2004, at 11:51 AM, Geoffrey Young wrote:
basically it goes into $HOME because it stores the A-T preferences for a
specific user. but this is all part of the endless 'sticky preferences' foo
that I really don't want to be associated with ;) lots of to and fro in the
httpd-test archives, though...
Here's the patch for Apache::TestMB. Unfortunately, I have to completely override Module::Build's implementation of testcover because it, too, sets the environment variables, so we'd lose the addition of the .apache-test directory.
--- lib/Apache/TestMB.pm.~1.7.~ Tue Sep 7 19:19:21 2004
+++ lib/Apache/TestMB.pm Tue Oct 5 12:32:11 2004
@@ -60,6 +60,26 @@
'-bugreport', '-verbose=' . ($self->verbose || 0));
}
+sub ACTION_testcover {
+ my $self = shift;
+
+ unless ($self->find_module_by_name('Devel::Cover', [EMAIL PROTECTED])) {
+ warn("Cannot run testcover action unless Devel::Cover "
+ . "is installed.\n");
+ return;
+ }
+
+ $self->add_to_cleanup('coverage', 'cover_db');
+
+ my $atdir = $self->localize_file_path("$ENV{HOME}/.apache-test");
+ local $Test::Harness::switches =
+ local $Test::Harness::Switches =
+ local $ENV{HARNESS_PERL_SWITCHES} = "-MDevel::Cover=+inc,'$atdir'";
+
+ $self->depends_on('test');
+ $self->do_system('cover');
+}
+
sub _bliblib {
my $self = shift;
return (
@@ -233,6 +253,12 @@
This action actually the tests by executing the test script,
F<t/TEST>. It is executed by the C<test> action, so most of the time
it won't be executed directly.
+
+=item testcover
+
+C<Apache::TestMB> overrides this action from C<Module::Build> in order to
+prevent the C<Apache::Test> preference files from being included in the test
+coverage.
=back
Geoff, should I go ahead and commit this to A-T?
Regards,
David