#!perl -w

use strict;
use Test::Harness::Straps;
my $straps = Test::Harness::Straps->new;
my $pad = 20;
local $ENV{PERL5LIB} = $straps->_INC2PERL5LIB;

my $ok = 1;

foreach my $f ( glob 't/*.t' ) {
  local *IN;
  open IN, "perl p2e.pl --quiet --run-exe $f |";
  ( my $n = $f ) =~ s/\.t\w?$//;

  print $n, ( '.' x ( $pad - length $n ) );

  my %r = $straps->analyze_fh( $n, \*IN );

  if( $r{skip_all} ) {
    print "skipped: ", $r{skip_all}, "\n";
  } elsif( $r{passing} && $r{seen} ) {
    print "ok\n";
  } else {
    $ok = 0;
    print "FAILED\n";
  }
}

if( $ok ) {
  print "All tests successful.\n";
} else {
  print "Some tests failed.\n";
}

exit !$ok; # 0 == success, 1 == failure

# local variables:
# mode: cperl
# end:
