gozer 2004/09/16 14:36:13
Modified: perl-framework/Apache-Test Changes
perl-framework/Apache-Test/lib/Apache TestConfig.pm
Log:
Added an apxs query cache for improved test performance
Revision Changes Path
1.166 +2 -0 httpd-test/perl-framework/Apache-Test/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -r1.165 -r1.166
--- Changes 15 Sep 2004 23:55:31 -0000 1.165
+++ Changes 16 Sep 2004 21:36:13 -0000 1.166
@@ -8,6 +8,8 @@
=item 1.14-dev
+Added an apxs query cache for improved test performance [Gozer]
+
run_tests make target no longer invokes t/TEST -clean, making it
possible to save a few development cycles when a full cleanup is
not required between runs. [Geoffrey Young]
1.245 +18 -11
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
Index: TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.244
retrieving revision 1.245
diff -u -r1.244 -r1.245
--- TestConfig.pm 5 Sep 2004 16:30:30 -0000 1.244
+++ TestConfig.pm 16 Sep 2004 21:36:13 -0000 1.245
@@ -1620,20 +1620,27 @@
sub apxs {
my($self, $q, $ok_fail) = @_;
return unless $self->{APXS};
- local @ENV{ qw(PATH IFS CDPATH ENV BASH_ENV) };
- my $devnull = devnull();
- my $apxs = shell_ready($self->{APXS});
- my $val = qx($apxs -q $q 2>$devnull);
- chomp $val if defined $val; # apxs post-2.0.40 adds a new line
- unless ($val) {
- if ($ok_fail) {
- return "";
+ my $val;
+ unless (exists $self->{_apxs}{$q}) {
+ local @ENV{ qw(PATH IFS CDPATH ENV BASH_ENV) };
+ my $devnull = devnull();
+ my $apxs = shell_ready($self->{APXS});
+ $val = qx($apxs -q $q 2>$devnull);
+ chomp $val if defined $val; # apxs post-2.0.40 adds a new line
+ if ($val) {
+ $self->{_apxs}{$q} = $val;
}
- else {
- warn "APXS ($self->{APXS}) query for $q failed\n";
+ unless ($val) {
+ if ($ok_fail) {
+ return "";
+ }
+ else {
+ warn "APXS ($self->{APXS}) query for $q failed\n";
+ return $val;
+ }
}
}
- $val;
+ $self->{_apxs}{$q};
}
sub pop_dir {