diff options
Diffstat (limited to 'yamlishwriter-php-v0.0.1/t/harness.t')
-rw-r--r-- | yamlishwriter-php-v0.0.1/t/harness.t | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/yamlishwriter-php-v0.0.1/t/harness.t b/yamlishwriter-php-v0.0.1/t/harness.t new file mode 100644 index 0000000..abc51f8 --- /dev/null +++ b/yamlishwriter-php-v0.0.1/t/harness.t @@ -0,0 +1,29 @@ +use strict; +use warnings; + +my $php = $ENV{PHP} || 'php'; + +my $TESTS = 't/*.php'; + +my $planned = 0; + +for my $test ( glob( $TESTS ) ) { + warn "# $test\n"; + my $offset = $planned; + my @command = ( $php, $test ); + open my $th, '-|', @command or die "Can't run $test ($?)\n"; + while ( defined( my $line = <$th> ) ) { + chomp $line; + if ( $line =~ /^1..(\d+)/ ) { + $planned += $1; + } + else { + $line =~ s/^((?:not\s+)?ok\s+)(\d+)/$1 . ($2 + $offset)/e; + print "$line\n"; + } + } + close $th or die "Can't run $test ($?)\n"; +} + +# Trailing plan +print "1..$planned\n"; |