Test::Harness and skiping tests functionality
authorNikola Knezevic <indy@tesla.rcub.bg.ac.yu>
Tue, 28 May 2002 08:17:53 +0000 (10:17 +0200)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 28 May 2002 12:26:34 +0000 (12:26 +0000)
Message-ID: <40949173.20020528081753@tesla.rcub.bg.ac.yu>

p4raw-id: //depot/perl@16829

ext/POSIX/t/waitpid.t
lib/Test/Harness.pm
lib/Test/Harness/Straps.pm
t/op/64bitint.t
t/test.pl

index f2e9c06..e163371 100644 (file)
@@ -6,17 +6,17 @@ BEGIN {
 BEGIN {
     use Config;
     unless ($Config{d_fork}) {
-       print "1..0 # no fork\n";
+       print "1..0 # Skip: no fork\n";
        exit 0;
     }
     eval { use POSIX qw(sys_wait_h) };
     if ($@) {
-       print "1..0 # no POSIX sys_wait_h\n";
+       print "1..0 # Skip: no POSIX sys_wait_h\n";
        exit 0;
     }
     eval { use Time::HiRes qw(time) };
     if ($@) {
-       print "1..0 # no Time::HiRes\n";
+       print "1..0 # Skip: no Time::HiRes\n";
        exit 0;
     }
 }
index 0efaa53..be04797 100644 (file)
@@ -159,6 +159,13 @@ emitted if the test script is skipped completely:
 
   1..0 # Skipped: no leverage found
 
+If you don't have any comment on skipping, just print C<1..0> with 
+nothing after it. Test::Harness will say something like this:
+
+op/64bitint..............skipped
+       skipped: no reason given
+       
+
 =item B<Todo tests>
 
 If the standard output line contains the substring C< # TODO> after
index 173b26b..8ce5722 100644 (file)
@@ -444,7 +444,11 @@ sub _is_header {
         $self->{max}  = $max;
         assert( $self->{max} >= 0,  'Max # of tests looks right' );
 
-        if( defined $extra ) {
+               if( not $max and not $extra) {
+                       #We're skipping, thats for sure
+                       $self->{skip_all} = 'no reason given';
+               }
+               elsif( defined $extra ) {
             my($todo, $skip, $reason) = $extra =~ /$Extra_Header_Re/xo;
 
             $self->{todo} = { map { $_ => 1 } split /\s+/, $todo } if $todo;
index 494f9fd..e8314fa 100644 (file)
@@ -3,7 +3,7 @@
 BEGIN {
        eval { my $q = pack "q", 0 };
        if ($@) {
-               print "1..0\n# Skip: no 64-bit types\n";
+               print "1..0 # Skip: no 64-bit types\n";
                exit(0);
        }
        chdir 't' if -d 't';
index 7df12b6..9b3d9d6 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -40,7 +40,7 @@ sub _diag {
 
 sub skip_all {
     if (@_) {
-       print STDOUT "1..0 - @_\n";
+       print STDOUT "1..0 # Skipped: @_\n";
     } else {
        print STDOUT "1..0\n";
     }