Upgrade to Test::Harness 2.27_04.
authorJarkko Hietaniemi <jhi@iki.fi>
Sun, 13 Apr 2003 09:02:05 +0000 (09:02 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 13 Apr 2003 09:02:05 +0000 (09:02 +0000)
p4raw-id: //depot/perl@19195

MANIFEST
lib/Test/Harness.pm
lib/Test/Harness/Straps.pm
lib/Test/Harness/t/pod.t [new file with mode: 0644]
lib/Test/Harness/t/test-harness.t
t/lib/sample-tests/switches [new file with mode: 0644]

index c03acf0..7fb5574 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1531,6 +1531,7 @@ lib/Test/Harness/t/base.t Test::Harness test
 lib/Test/Harness/t/callback.t  Test::Harness test
 lib/Test/Harness/t/nonumbers.t Test::Harness test
 lib/Test/Harness/t/ok.t                Test::Harness test
+lib/Test/Harness/t/pod.t       Test::Harness test
 lib/Test/Harness/t/strap-analyze.t     Test::Harness::Straps test
 lib/Test/Harness/t/strap.t             Test::Harness::Straps test
 lib/Test/Harness/t/test-harness.t      Test::Harness test
@@ -2501,6 +2502,7 @@ t/lib/sample-tests/skip                   Test data for Test::Harness
 t/lib/sample-tests/skip_nomsg          Test data for Test::Harness
 t/lib/sample-tests/skipall             Test data for Test::Harness
 t/lib/sample-tests/skipall_nomsg       Test data for Test::Harness
+t/lib/sample-tests/switches            Test data for Test::Harness
 t/lib/sample-tests/taint               Test data for Test::Harness
 t/lib/sample-tests/todo                        Test data for Test::Harness
 t/lib/sample-tests/todo_inline         Test data for Test::Harness
index 50de3b5..b954626 100644 (file)
@@ -1,5 +1,5 @@
 # -*- Mode: cperl; cperl-indent-level: 4 -*-
-# $Id: Harness.pm,v 1.43 2003/03/24 20:09:50 andy Exp $
+# $Id: Harness.pm,v 1.45 2003/04/13 03:34:09 andy Exp $
 
 package Test::Harness;
 
@@ -22,7 +22,7 @@ use vars qw($VERSION $Verbose $Switches $Have_Devel_Corestack $Curtest
 
 $Have_Devel_Corestack = 0;
 
-$VERSION = '2.27_02';
+$VERSION = '2.27_04';
 
 $ENV{HARNESS_ACTIVE} = 1;
 
@@ -328,6 +328,7 @@ It returns true if everything was ok.  Otherwise it will die() with
 one of the messages in the DIAGNOSTICS section.
 
 =for _private
+
 This is just _run_all_tests() plus _show_results()
 
 =cut
index 6ce6b2d..dc3e4b6 100644 (file)
@@ -1,5 +1,5 @@
 # -*- Mode: cperl; cperl-indent-level: 4 -*-
-# $Id: Straps.pm,v 1.16 2003/02/02 05:27:44 schwern Exp $
+# $Id: Straps.pm,v 1.17 2003/04/03 17:47:25 andy Exp $
 
 package Test::Harness::Straps;
 
@@ -324,7 +324,7 @@ sub _switches {
     local *TEST;
     open(TEST, $file) or print "can't open $file. $!\n";
     my $first = <TEST>;
-    my $s = '';
+    my $s = $Test::Harness::Switches || '';
     $s .= " $ENV{'HARNESS_PERL_SWITCHES'}"
       if exists $ENV{'HARNESS_PERL_SWITCHES'};
 
diff --git a/lib/Test/Harness/t/pod.t b/lib/Test/Harness/t/pod.t
new file mode 100644 (file)
index 0000000..5a048b2
--- /dev/null
@@ -0,0 +1,20 @@
+use Test::More;
+
+use File::Spec;
+use File::Find;
+use strict;
+
+eval "use Test::Pod 0.95";
+
+if ($@) {
+    plan skip_all => "Test::Pod v0.95 required for testing POD";
+} else {
+    Test::Pod->import;
+    my @files;
+    my $blib = File::Spec->catfile(qw(blib lib));
+    find( sub {push @files, $File::Find::name if /\.p(l|m|od)$/}, $blib);
+    plan tests => scalar @files;
+    foreach my $file (@files) {
+       pod_file_ok($file);
+    }
+}
index f8d8c28..8a5f687 100644 (file)
@@ -452,13 +452,29 @@ my %samples = (
                                            },
                                  all_ok => 0,
                                 },
+            switches         => {
+                                  total => {
+                                            bonus      => 0,
+                                            max        => 1,
+                                            'ok'       => 1,
+                                            files      => 1,
+                                            bad        => 0,
+                                            good       => 1,
+                                            tests      => 1,
+                                            sub_skipped=> 0,
+                                            'todo'     => 0,
+                                            skipped    => 0,
+                                           },
+                                  failed => { },
+                                  all_ok => 1,
+                                 },
            );
 
 plan tests => (keys(%samples) * 8) + 1;
 
 use Test::Harness;
 use_ok('Test::Harness');
-
+$Test::Harness::Switches = '"-Mstrict"';
 
 tie *NULL, 'My::Dev::Null' or die $!;
 
diff --git a/t/lib/sample-tests/switches b/t/lib/sample-tests/switches
new file mode 100644 (file)
index 0000000..8ce9c9a
--- /dev/null
@@ -0,0 +1,2 @@
+print "1..1\n";
+print $INC{'strict.pm'} ? "ok 1\n" : "not ok 1\n";