Closed daxim closed 10 years ago
file simple.t
simple.t
use Test::Simple tests => 1; ok 1, 'some test';
file more.t
more.t
use Test::More; ok 1, 'some test'; done_testing;
Running these tests produces the pretty output with colours, checkmarks and fat arrows around filenames – as expected.
$ prove -v -Pretty simple.t more.t ==> simple.t <== ✓ some test ok ==> more.t <==== ✓ some test ok All tests successful. Files=2, Tests=2, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.09 cusr 0.00 csys = 0.12 CPU) Result: PASS
If TAP is generated in other ways, Test::Pretty fails to do its work.
file manual-tap.t
manual-tap.t
#!/usr/bin/perl print <<'END' ok 1 - some test 1..1 END
No colours/checkmarks:
$ prove -v -Pretty manual-tap.t ok 1 - some test 1..1 ok All 1 subtests passed
Non-Perl TAP generation:
file manual-tap.sh
manual-tap.sh
#!/bin/sh echo "ok 1 - some test" echo "1..1"
$ prove -v -Pretty -e sh manual-tap.sh ok 1 - some test 1..1
Recorded TAP stream:
file manual-tap.tap
manual-tap.tap
ok 1 - some test 1..1
$ prove -v -Pretty -e cat manual-tap.tap ok 1 - some test 1..1
Streaming TAP into pipe:
$ printf "ok 1 - some test\n1..1\n" | prove -v -Pretty -e 'cat -' /dev/null
Checkmark is missing.
==> /dev/null <== ok 1 - some test 1..1 All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU) Result: PASS
Test::Pretty hacks perl level functions. It don't affect to non-perl programs.
file
simple.t
file
more.t
Running these tests produces the pretty output with colours, checkmarks and fat arrows around filenames – as expected.
If TAP is generated in other ways, Test::Pretty fails to do its work.
file
manual-tap.t
No colours/checkmarks:
Non-Perl TAP generation:
file
manual-tap.sh
No colours/checkmarks:
Recorded TAP stream:
file
manual-tap.tap
No colours/checkmarks:
Streaming TAP into pipe:
Checkmark is missing.