NAME

App::Yath - Yet Another Test Harness, alternative to prove

DESCRIPTION

This package implements the yath command line tool.

SYNOPSIS

COMMAND LINE

yath [options] [files] [directories]

IN A SCRIPT

MINIMAL

use App::Yath;
my $yath = App::Yath->new(args => \@ARGV);
my $exit = $yath->run();
exit($exit);

This minimal version is all most people will need. However it is recommended you use the complete form below. The complete form does a much better job of backing out of stack frames in preload+fork mode. Using the minimal can cause problems in some edge cases where tests assume there are no stack frames outside the test script itself.

COMPLETE

use App::Yath;

T2_DO_FILE: {
    my $yath = App::Yath->new(args => \@ARGV);
    my $exit = $yath->run();
    exit($exit);
}

my $file = $Test2::Harness::Runner::DO_FILE
    or die "No file to run!";

# Test files do not always return a true value, so we cannot use require. We
# also cannot trust $!
package main;
$@ = '';
do $file;
die $@ if $@;
exit 0;

In preload+fork mode the runner will attempt to break out to the T2_DO_FILE label. If the example above is inserted into your top-level script then the script will be able to run with minimal stack trace noise.

COMMAND LINE ARGUMENTS

COMMON

OTHER OPTIONS

METHODS

SOURCE

The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.

MAINTAINERS

AUTHORS

COPYRIGHT

Copyright 2016 Chad Granum exodist7@gmail.com.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/