Apache-Test

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


=item 1.32 April 15, 2010

Fix issue with recent feature where lack of libapreq resulted in test failure.
[Philippe M. Chiasson]

Added t_{start,read,finish}_file_watch to Apache::TestUtil [Torsten Foertsch]

=item 1.31 February 24, 2010

Modify need_cgi so that it looks for cgi.c instead of cgi.  This is a fix
for the case insensitive filesystem correction listed below.
[Phillipe M. Chiasson]

t/next_available_port.t doesn't need mod_cgid, use need_cgi instead
of need_module('mod_cgi.c')
[Philippe M. Chiasson]

PR: 21554
Load mod_apreq2.so if it is available
[Derek Price, <derek@ximbiot.com>]

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

a simple GET to C<bar.php>, leaving the actual testing to C<bar.php>.  in
essence, you can forget that C<bar.t> even exists.

what does C<bar.php> look like?  here is an example:

  <?php
    print "1..1\n";
    print "ok 1\n"
  ?>

if it looks odd, that's ok because it is.  I could explain to you exactly
what this means, but it isn't important to understand the gory details.
instead, it is sufficient to understand that when C<Apache::Test> calls
C<bar.php> it feeds the results directly to C<Test::Harness>, a module
that comes with every Perl installation, and C<Test::Harness> expects
what it receives to be formated in a very specific way.  by itself, all
of this is pretty useless, so C<Apache::Test> provides PHP testers with
something much better.  here is a much better example:

  <?php
    # import the Test::More emulation layer

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

    local $/=\$record_length;
    @lines=t_finish_file_watch($name);
  }

=item t_file_watch_for()

  @lines=Apache::TestUtil::t_file_watch_for('access_log',
                                            qr/condition/,
                                            $timeout);

This function reads the file from the current position and looks for the
first line that matches C<qr/condition/>. If no such line could be found
until end of file the function pauses and retries until either such a line
is found or the timeout (in seconds) is reached.

In scalar or void context only the matching line is returned. In list
context all read lines are returned with the matching one in last position.

The function uses C<\n> and end-of-line marker and waits for complete lines.

The timeout although it can be specified with sub-second precision is not very



( run in 0.357 second using v1.01-cache-2.11-cpan-64827b87656 )