Apache-Test
view release on metacpan or search on metacpan
Fix loading apache_test_config.pm for recent perls in which '.' is
no longer in @INC by default. [Steve Hay]
=item 1.41 Jul 11 2019
Set DefaultStateDir for > 2.5.1 and add -t_state to override. [jorton]
Inherit config via IncludeOptional as well as Include. [jorton]
Increase size of MinSpare, MaxSpare and MaxClients to improve httpd test
framework runs with worker and preform MPMs. [rjung]
Changed the openssl version detection to work with other *SSL libraries.
[icing]
Switch test framework from using Net::SSL for
raw TLS sockets to IO::Socket::SSL. [rjung]
Fix mod_ssl tests under OpenSSL 1.1.1 / TLSv1.3. [jorton]
Add cwd to generated lib path in TEST script since Perl >=5.26 don't
do that any more. [jorton]
Override loglevel to trace8 if running in 2.4. [covener]
Allow an empty PREFIX. [sf]
time to some other directory on the system. [Stas]
=item 1.16 - November 9, 2004
launder the require()d custom config filename to make -T happy
[Torsten Förtsch <torsten.foertsch gmx.net>]
added Apache::TestRunPHP and Apache::TestConfigPHP classes,
which provide a framework for server-side testing via PHP scripts
[Geoffrey Young]
fix problem with multiple all.t files where only the final
file was being run through the test harness. [Geoffrey Young]
Documented that redirection does not work with "POST" requests in
Apache::TestRequest unless LWP is installed. [David Wheeler]
Separated the setting of the undocumented $RedirectOK package
variable by users of Apache::TestRequest from when it is set
add automatic core dump backtrace generation in t/REPORT if
Devel::GDB is installed [Gozer]
add 'testcover' make target for running tests with Devel::Cover
[Geoffrey Young]
=item 1.14 - October 12, 2004
improve the same_interpreter framework to handle response failures
while trying to init and later find out the same interpreter. [Stas]
make sure that 'make distclean' cleans all the autogenerated files
[Stas]
make sure that if -maxclients option is passed on the command line,
minclients will never be bigger than that value [Stas]
add -one-process runtime argument, which will start the server
in single-server mode (httpd -X in Apache 1.X or
t_server_log_error_is_expected t_server_log_warn_is_expected
t_client_log_error_is_expected t_client_log_warn_is_expected
now support an optional argument, suggesting how many entries
to expect [Stas]
=item 1.09 - March 8, 2004
remove the dependency on APR::UUID (i.e. mod_perl 2.0) in the
same_interpreter framework (use plain time/rand/$$ concatenation)
[Stas]
Updated to the new Apache License Version 2.0 [Gozer]
handle cases on Win32 when supplied paths have spaces in their
names [Stas]
c-modules build errors are no longer ignored [Stas]
change -DAPACHE1 (and like defines) to -D APACHE1 to fix Win32
prefix Apache::TestTrace (non-colour mode) messages with the loglevel,
similar to what Apache does. [Stas]
Instrument A-T with an optional successful (shell-wise) abort of the
test suite, by asking the user whether they want to continue w/o
completing the test suite. Use it in places where we know that the
test suite will certaionly fail (e.g. running from /root as 'root', or
not providing httpd/apxs locations). [Stas]
In order to make Apache-Test compatible with the rest of Perl testing
frameworks, we no longer chdir into t/, but run from the root of the
project (where t/ resides). A test needing to know where it's running
from (e.g. to read/write files/dirs on the filesystem), should do that
relative to the serverroot, documentroot and other server
configuration variables, available via
Apache::Test::vars('serverroot'), Apache::Test::vars('documentroot'),
etc. [Stas]
Apache::Test::vars() can now query for config arguments [Stas]
generate t/conf if it does not already exist, which
t/conf/apache_test_config.pm now gets written, so t/TEST -clean can work
However if the problem happens during 'make test' for
some reason Makefile doesn't abort on exit from test_clean target, no
matter if I put exit -1, 0 or 1, and proceeds with run_tests target.
probably, since __DIE__ will stop the server.
to reproduce the problem during configure() apply this patch:
Index: Apache-Test/lib/Apache/TestConfigPerl.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm,v
retrieving revision 1.38
diff -u -r1.38 TestConfigPerl.pm
--- Apache-Test/lib/Apache/TestConfigPerl.pm 2001/10/18 04:18:16 1.38
+++ Apache-Test/lib/Apache/TestConfigPerl.pm 2001/10/19 02:14:56
@@ -347,6 +347,7 @@
if (open $fh, $file) {
my $content = <$fh>;
close $fh;
+ require $file;
if ($content =~ /APACHE_TEST_CONFIGURE/m) {
lib/Apache/Test.pm view on Meta::CPAN
instead of I<Test.pm> behind the scenes. Note that you are not
required to C<use Test::More> yourself with the C<-withtestmore>
option and that the C<use Test::More tests =E<gt> 1> syntax
may have unexpected results.
Note that I<Test::More> version 0.49, available within the
I<Test::Simple> 0.49 distribution on CPAN, or greater is required
to use this feature.
Because I<Apache:Test> was initially developed using I<Test> as
the framework driver, complete I<Test::More> integration is
considered experimental at this time - it is supported as best as
possible but is not guaranteed to be as stable as the default I<Test>
interface at this time.
=head1 Apache::TestToString Class
The I<Apache::TestToString> class is used to capture I<Test.pm> output
into a string. Example:
Apache::TestToString->start;
lib/Apache/TestConfig.pm view on Meta::CPAN
my $time = scalar localtime;
my $warning = "WARNING: this file is generated";
$warning .= " (from $from_filename)" if defined $from_filename;
$warning .= ", do not edit\n";
$warning .= "generated on $time\n";
$warning .= calls_trace();
return $self->warn_style_sub_ref($filename)->($warning);
}
sub calls_trace {
my $frame = 1;
my $trace = '';
while (1) {
my($package, $filename, $line) = caller($frame);
last unless $filename;
$trace .= sprintf "%02d: %s:%d\n", $frame, $filename, $line;
$frame++;
}
return $trace;
}
sub clean_add_file {
my($self, $file) = @_;
$self->{clean}->{files}->{ rel2abs($file) } = 1;
}
lib/Apache/TestConfig.pm view on Meta::CPAN
# there is none. should probably add some flag which will tell us
# when httpd_config was already run
return unless $self->{vars}->{httpd} && $self->{vars}->{ssl_module};
return unless $self->sslca_can;
Apache::TestSSLCA::clean($self);
}
#XXX: just a quick hack to support t/TEST -ssl
#outside of httpd-test/perl-framework
sub generate_ssl_conf {
my $self = shift;
my $vars = $self->{vars};
my $conf = "$vars->{t_conf}/ssl";
my $httpd_test_ssl = "../httpd-test/perl-framework/t/conf/ssl";
my $ssl_conf = "$vars->{top_dir}/$httpd_test_ssl";
if (-d $ssl_conf and not -d $conf) {
$self->gendir($conf);
for (qw(ssl.conf.in)) {
$self->cpfile("$ssl_conf/$_", "$conf/$_");
}
for (qw(certs keys crl)) {
$self->symlink("$ssl_conf/$_", "$conf/$_");
}
lib/Apache/TestConfig.pm view on Meta::CPAN
automagically created.
The directory C<$dir> and any created parent directories will be
automatically removed on cleanup if found empty.
=back
=head1 Environment Variables
The following environment variables affect the configuration and the
run-time of the C<Apache::Test> framework:
=head2 APACHE_TEST_COLOR
To aid visual control over the configuration process and the run-time
phase, C<Apache::Test> uses coloured fonts when the environment
variable C<APACHE_TEST_COLOR> is set to a true value.
=head2 APACHE_TEST_LIVE_DEV
When using C<Apache::Test> during the project development phase, it's
lib/Apache/TestConfigPHP.pm view on Meta::CPAN
session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
[Assertion]
[COM]
lib/Apache/TestHarness.pm view on Meta::CPAN
#test if all.t would skip tests or not
{
my $source_lib = '';
sub run_t {
my($self, $file) = @_;
my $ran = 0;
if (Apache::TestConfig::IS_APACHE_TEST_BUILD and !length $source_lib) {
# so we can find Apache/Test.pm from both the perl-framework/
# and Apache-Test/
my $top_dir = Apache::Test::vars('top_dir');
foreach my $lib (catfile($top_dir, qw(Apache-Test lib)),
catfile($top_dir, qw(.. Apache-Test lib)),
catfile($top_dir, 'lib')) {
if (-d $lib) {
info "adding source lib $lib to \@INC";
$source_lib = qq[-Mlib="$lib"];
lib/Apache/TestRun.pm view on Meta::CPAN
}
sub set_perl5lib {
$ENV{PERL5LIB} = join $Config{path_sep}, shift->test_inc();
}
sub set_perldb_opts {
my $config = shift->{test_config};
my $file = catfile $config->{vars}->{t_logs}, 'perldb.out';
$config->genfile($file); #mark for -clean
$ENV{PERLDB_OPTS} = "NonStop frame=4 AutoTrace LineInfo=$file";
warning "perldb log is t/logs/perldb.out";
}
sub opt_debug {
my $self = shift;
my $server = $self->{server};
my $opts = $self->{opts};
my $debug_opts = {};
lib/Apache/TestRunPHP.pm view on Meta::CPAN
Refer to the C<Apache::TestRun> manpage for information on the
available API.
=head1 EXAMPLE
C<TestRunPHP> works almost identially to C<TestRunPerl>, but in
case you are new to C<Apache-Test> here is a quick getting started
guide. be sure to see the links at the end of this document for
places to find additional details.
because C<Apache-Test> is a Perl-based testing framework we start
from a C<Makefile.PL>, which should have the following lines (in
addition to the standard C<Makefile.PL> parts):
use Apache::TestMM qw(test clean);
use Apache::TestRunPHP ();
Apache::TestMM::filter_args();
Apache::TestRunPHP->generate_script();
C<generate_script()> will create a script named C<t/TEST>, the gateway
to the Perl testing harness and what is invoked when you call
C<make test>. C<filter_args()> accepts some C<Apache::Test>-specific
arguments and passes them along. for example, to point to a specific
C<httpd> installation you would invoke C<Makefile.PL> as follows
$ perl Makefile.PL -httpd /my/local/apache/bin/httpd
and C</my/local/apache/bin/httpd> will be propagated throughout the
rest of the process. note that PHP needs to be active within Apache
prior to configuring the test framework as shown above, either by
virtue of PHP being compiled into the C<httpd> binary statically or
through an active C<LoadModule> statement within the configuration
located in C</my/local/apache/conf/httpd.conf>. Other required modules
are the (very common) mod_alias and mod_env.
now, like with C<Apache::TestRun> and C<Apache::TestRunPerl>, you can
place client-side Perl test scripts under C<t/>, such as C<t/01basic.t>,
and C<Apache-Test> will run these scripts when you call C<make test>.
however, what makes C<Apache::TestRunPHP> unique is some added magic
specifically tailored to a PHP environment. here are the mechanics.
( run in 1.258 second using v1.01-cache-2.11-cpan-e1769b4cff6 )