perl-test-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r165315 - /perl/Apache-Test/trunk/lib/Apache/Test.pm
Date Fri, 29 Apr 2005 15:37:36 GMT
Author: geoff
Date: Fri Apr 29 08:37:35 2005
New Revision: 165315

URL: http://svn.apache.org/viewcvs?rev=165315&view=rev
Log:
revert back to 165201 - changes inadvertently made in trunk
instead of test-more-unstable

Modified:
    perl/Apache-Test/trunk/lib/Apache/Test.pm

Modified: perl/Apache-Test/trunk/lib/Apache/Test.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/Test.pm?rev=165315&r1=165314&r2=165315&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/Test.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/Test.pm Fri Apr 29 08:37:35 2005
@@ -17,10 +17,6 @@
 use strict;
 use warnings FATAL => 'all';
 
-# must be run first, so that Test::Builder will be threads-aware
-BEGIN { use Config; require threads if $] >= 5.008 && $Config{useithreads}}
-use Test::Builder;
-
 use Exporter ();
 use Config;
 use Apache::TestConfig ();
@@ -60,7 +56,12 @@
 sub import {
     my $class = shift;
 
-        $real_plan = eval {
+    # once Test::More always Test::More until plan() is called
+    if (($_[0] and $_[0] =~ m/^-withtestmore/) || @testmore) {
+        # special hoops for Test::More support
+
+        $real_plan = eval { 
+
             require Test::More; 
 
             no warnings qw(numeric);
@@ -79,6 +80,15 @@
         # clean up arguments to export_to_level
         shift;
         @EXPORT = (@test_more_exports, @Test::More::EXPORT);
+    }
+    else {
+        # the default - Test.pm support
+
+        require Test;
+        Test->import(qw(ok skip));
+        @testmore = ();               # reset, just in case.
+        $real_plan = \&Test::plan;
+    }
 
     $class->export_to_level(1, undef, @_ ? @_ : @EXPORT);
 }
@@ -496,13 +506,8 @@
 
 package Apache::TestToString;
 
-use Config;
 sub TIEHANDLE {
     my $string = "";
-    if ($] >= 5.008 && $Config{useithreads} && $INC{'threads.pm'}) {
-        require threads::shared;
-        &threads::shared::share(\$string);
-    }
     bless \$string;
 }
 
@@ -525,22 +530,6 @@
     untie *STDOUT;
     $s;
 }
-
-package Apache::TestToStringRequest;
-
-sub new {
-    my($class, $r) = @_;
-    die '$r is required' unless $r;
-    Apache::TestToString->start;
-    return bless \$r, __PACKAGE__;
-}
-
-sub DESTROY {
-    my $self = shift;
-    $$self->print(Apache::TestToString->finish);
-}
-
-
 
 1;
 __END__



Mime
View raw message