You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by ge...@apache.org on 2005/01/28 02:50:50 UTC
svn commit: r147572 - /httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestHarnessPHP.pm /httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm
Author: geoff
Date: Thu Jan 27 17:50:49 2005
New Revision: 147572
URL: http://svn.apache.org/viewcvs?view=rev&rev=147572
Log:
require Test::Harness 2.38 (perl 5.8.3) for running
php client-side scripts
Modified:
httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestHarnessPHP.pm
httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm
Modified: httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestHarnessPHP.pm
Url: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestHarnessPHP.pm?view=diff&rev=147572&p1=httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestHarnessPHP.pm&r1=147571&p2=httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestHarnessPHP.pm&r2=147572
==============================================================================
--- httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestHarnessPHP.pm (original)
+++ httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestHarnessPHP.pm Thu Jan 27 17:50:49 2005
@@ -20,17 +20,20 @@
use File::Spec::Functions qw(catfile catdir);
use File::Find qw(finddepth);
use Apache::TestHarness ();
+use Apache::TestTrace;
use vars qw(@ISA);
@ISA = qw(Apache::TestHarness);
-# Test::Harness didn't start using Test::Harness::Straps until 5.8.0
-# everything except t/foo.php with earlier perls, so let things
-# go for the moment
-eval {
- require Test::Harness::Straps;
+# Test::Harness didn't start using Test::Harness::Straps until 2.38
+# everything except t/foo.php with earlier versions, so let things go
+# on without it
+my $phpclient = eval {
+ require Test::Harness;
+ Test::Harness->VERSION(2.38);
push @ISA, qw(Test::Harness::Straps);
$Test::Harness::Strap = __PACKAGE__->new;
+ 1;
};
sub get_tests {
@@ -62,7 +65,7 @@
}
else {
finddepth(sub {
- return unless /(\.t|\.php)$/;
+ return unless /\.(t|php)$/;
my $t = catfile $File::Find::dir, $_;
my $dotslash = catfile '.', "";
$t =~ s:^\Q$dotslash::;
@@ -86,6 +89,18 @@
#when running 't/TEST t/dir' shell tab completion adds a /
#dir//foo output is annoying, fix that.
s:/+:/:g for @tests;
+
+ # remove *.php tests unless we can run them with php
+ if (! Apache::TestConfig::which('php')) {
+ warning(join ' - ', 'skipping *.php tests',
+ 'make sure php is in your PATH');
+ @tests = grep { not /\.php$/ } @tests;
+ }
+ elsif (! $phpclient) {
+ warning(join ' - ', 'skipping *.php tests',
+ 'Test::Harness 2.38 not available');
+ @tests = grep { not /\.php$/ } @tests;
+ }
return @tests;
}
Modified: httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm
Url: http://svn.apache.org/viewcvs/httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm?view=diff&rev=147572&p1=httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm&r1=147571&p2=httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm&r2=147572
==============================================================================
--- httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm (original)
+++ httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRunPHP.pm Thu Jan 27 17:50:49 2005
@@ -307,7 +307,7 @@
pattern of your PHP script. C<t/php/bar.t> happens to be written in
Perl, but you really don't need to worry about it too much.
-as an interesting aside, if you are using perl-5.8.0 or later you can
+as an interesting aside, if you are using perl-5.8.3 or later you can
actually create your own C<t/foo.php> client-side scripts and they
will be run via php (using our C<php.ini>). but more on that later...