Apache-Test

 view release on metacpan or  search on metacpan

lib/Apache/TestMB.pm  view on Meta::CPAN

            "use $class ();",
            "$class->new->run(\@ARGV);";
    }

    # Make it so!
    print "Generating test running script $script\n" if $self->verbose;
    Apache::Test::basic_config()->write_perlscript($script, $body);
    $self->add_to_cleanup($self->apache_test_script);
}


1;
__END__

=head1 NAME

Apache::TestMB - Subclass of Module::Build to support Apache::Test

=head1 SYNOPSIS

Standard process for building & installing modules:

  perl Build.PL
  ./Build
  ./Build test
  ./Build install

Or, if you're on a platform (like DOS or Windows) that doesn't like the "./"
notation, you can do this:

  perl Build.PL
  perl Build
  perl Build test
  perl Build install

=head1 DESCRIPTION

This class subclasses C<Module::Build> to add support for testing
Apache integration with Apache::Test. It is broadly based on
C<Apache::TestMM>, and as such adds a number of build actions to a the
F<Build> script, while simplifying the process of creating F<Build.PL>
scripts.

Here's how to use C<Apache::TestMB> in a F<Build.PL> script:

  use Module::Build;

  my $build_pkg = eval { require Apache::TestMB }
      ? 'Apache::TestMB' : 'Module::Build';

  my $build = $build_pkg->new(
      module_name => 'My::Module',
  );
  $build->create_build_script;

This is identical to how C<Module::Build> is used. Not all target
systems may have C<Apache::Test> (and therefore C<Apache::TestMB>
installed, so we test for it to be installed, first. But otherwise,
its use can be exactly the same. Consult the
L<Module::Build|Module::Build> documentation for more information on
how to use it; L<Module::Build::Cookbook|Module::Build::Cookbook> may
be especially useful for those looking to migrate from
C<ExtUtils::MakeMaker>.

=head1 INTERFACE

=head2 Build

With the above script, users can build your module in the usual
C<Module::Build> way:

  perl Build.PL
  ./Build
  ./Build test
  ./Build install

If C<Apache::TestMB> is installed, then Apache will be started before
tests are run by the C<test> action, and shut down when the tests
complete. Note that C<Build.PL> can be called C<Apache::Test>-specific
options in addition to the usual C<Module::Build> options. For
example:

  perl Build.PL -apxs /usr/local/apache/bin/apxs

Consult the L<Apache::Test|Apache::Test> documentation for a complete
list of options.

In addition to the actions provided by C<Module::Build> (C<build>,
C<clean>, C<code>, C<test>, etc.), C<Apache::TestMB> adds a few extra
actions:

=over 4

=item test_clean

This action cleans out the files generated by the test script,
F<t/TEST>. It is also executed by the C<clean> action.

=item run_tests

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

=head2 Constructor

=head3 new

The C<new()> constructor takes all the same arguments as its parent in
C<Module::Build>, but can optionally accept one other parameter:

=over



( run in 2.133 seconds using v1.01-cache-2.11-cpan-6aa56a78535 )