hi all.
we have been using Apache-Test to run our entire testing framework, which is
great - we can mix and match apache-related and non-apache related tests
under the same testing tree and it all works without a hitch.
the only problem is that when working on small testing units that don't
require apache the overhead Apache-Test introduces when cleaning,
configuring, starting, and stopping the server is significant. so, I'd like
to add a new runtime option to remove apache-based foo from the test running
process. the usage would be something like this
$ t/TEST -no-httpd t/TMCS/Constants/01compile.t -v
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl /home/geoff/src/tmtest/unit/t/TEST
-no-httpd 't/TMCS/Constants/01compile.t' -v
[warning] skipping configuration: -no-httpd specified
t/TMCS/Constants/01compile....1..1
ok 1 - use TMCS::Constants;
ok
All tests successful.
the net result is that this takes, on average, half the time to run this
test when apache is taken out of the picture (, which is much better for
developers - reducing developer frustration is an important step toward the
road to overall test adoption :)
anyway, patch attached.
--Geoff
Index: TestRun.pm
===================================================================
RCS file: /home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.170
diff -u -r1.170 TestRun.pm
--- TestRun.pm 26 May 2004 02:14:36 -0000 1.170
+++ TestRun.pm 23 Jun 2004 18:39:25 -0000
@@ -49,7 +49,8 @@
my %original_t_perms = ();
my @std_run = qw(start-httpd run-tests stop-httpd);
-my @others = qw(verbose configure clean help ssl http11 bugreport save);
+my @others = qw(verbose configure clean help ssl http11 bugreport
+ save no-httpd);
my @flag_opts = (@std_run, @others);
my @string_opts = qw(order trace);
my @ostring_opts = qw(proxy ping);
@@ -68,6 +69,7 @@
'order=mode' => 'run the tests in one of the modes: ' .
'(repeat|rotate|random|SEED)',
'stop-httpd' => 'stop the test server',
+ 'no-httpd' => 'run the tests without configuring or starting httpd',
'verbose[=1]' => 'verbose output',
'configure' => 'force regeneration of httpd.conf ' .
' (tests will not be run)',
@@ -475,6 +477,11 @@
sub configure {
my $self = shift;
+ if ($self->{opts}->{'no-httpd'}) {
+ warning "skipping configuration: -no-httpd specified";
+ return
+ }
+
# create the conf dir as early as possible
$self->{test_config}->prepare_t_conf();
@@ -745,11 +752,11 @@
$self->die_on_invalid_args;
- $self->start;
+ $self->start unless $self->{opts}->{'no-httpd'};
$self->run_tests;
- $self->stop;
+ $self->stop unless $self->{opts}->{'no-httpd'};
}
# make it easy to move the whole distro w/o running