TAP
=title class Zef::Service::TAP
=subtitle A TAP module based implementation of the Tester interface
Synopsis
use Zef;
use Zef::Service::TAP;
my $tap = Zef::Service::TAP.new;
# Add logging if we want to see output
my $stdout = Supplier.new;
my $stderr = Supplier.new;
$stdout.Supply.tap: { say $_ };
$stderr.Supply.tap: { note $_ };
# Assuming our current directory is a raku distribution
# with no dependencies or all dependencies already installed...
my $dist-to-test = $*CWD;
my Str @includes = $*CWD.absolute;
my $passed = so $tap.test($dist-to-test, :@includes, :$stdout, :$stderr);
say $passed ?? "PASS" !! "FAIL";
Description
Tester
class for handling path based URIs ending in .rakutest / .t6 / .t using the raku TAP
module.
You probably never want to use this unless its indirectly through Zef::Test
;
handling files and spawning processes will generally be easier using core language functionality. This
class exists to provide the means for fetching a file using the Tester
interfaces that the e.g. Test
adapter uses.
Methods
method probe
method probe(--> Bool:D)
Returns True
if this module can successfully load the TAP
module.
method test-matcher
method test-matcher(Str() $uri --> Bool:D)
Returns True
if this module knows how to test $uri
, which it decides based on if $uri
exists
on local file system.
method test
method test(IO() $path, Str :@includes, Supplier :$stdout, Supplier :$stderr --> Bool:D)
Test the files ending in .rakutest
.t6
or .t
in the t/
directory of the given $path
using the
provided @includes
(e.g. /foo/bar
or inst#/foo/bar
) via the TAP
raku module. A Supplier
can be
supplied as :$stdout
and :$stderr
to receive any output.
Returns True
if there were no failed tests and no errors according to TAP
.