The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::Builder - *DEPRECATED* Module for building testing libraries.

DESCRIPTION

This module was previously the base module for almost any testing library. This module is now little more than a compatability wrapper around Test::Stream. If you are looking to write or update a testing library you should look at Test::Stream::Toolset.

PACKAGE VARS

$Test::Builder::Test

The variable that holds the Test::Builder singleton.

$Test::Builder::Level

In the past this variable was used to track stack depth so that Test::Builder could report the correct line number. If you use Test::Builder this will still work, but in new code it is better to use the Test::Stream::Context module.

METHODS

CONSTRUCTORS

Test::Builder->new

Returns the singleton stored in $Test::Builder::Test.

Test::Builder->create
Test::Builder->create(use_shared => 1)

Returns a new instance of Test::Builder. It is important to note that this instance will not use the shared Test::Stream object unless you pass in the use_shared => 1 argument.

UTIL

$TB->ctx

Helper method for Test::Builder to get a Test::Stream::Context object.

$TB->depth

Get the subtest depth

$TB->find_TODO
$TB->in_todo
$TB->todo

These all check on todo state and value

OTHER

$TB->caller
$TB->carp
$TB->croak

These let you figure out when/where the test is defined in the test file.

$TB->child

Start a subtest (Please do not use this)

$TB->finalize

Finish a subtest (Please do not use this)

$TB->explain

Interface to Data::Dumper that dumps whatever you give it.

$TB->exported_to

This used to tell you what package used Test::Builder, it never worked well. The previous bad and unpredictable behavior of this has largely been preserved, however nothing internal uses it in any meaningful way anymore.

$TB->is_fh

Check if something is a filehandle

$TB->level

Get/Set $Test::Builder::Level. $Level is a package var, and most thigns localize it, so this method is pretty useless.

$TB->maybe_regex

Check if something might be a regex.

$TB->reset

Reset the builder object to a very basic and default state. You almost certainly do not need this unless you are writing a tool to test testing libraries. Even then you probably do not want this.

$TB->todo_end
$TB->todo_start

Start/end TODO state, there are better ways to do this now.

STREAM INTERFACE

These simply interface into functionality of Test::Stream.

$TB->failure_output
$TB->output
$TB->reset_outputs
$TB->todo_output

These get/set the IO handle used in the 'legacy' tap encoding.

$TB->no_diag

Do not display Test::Stream::Event::Diag events.

$TB->no_ending

Do not do some special magic at the end that tells you what went wrong with tests.

$TB->no_header

Do not display the plan

$TB->use_numbers

Turn numbers in TAP on and off.

HISTORY

$TB->details

Get all the events that occured on this object. Each event will be transformed into a hash that matches the legacy output of this method.

$TB->expected_tests

Set/Get expected number of tests

$TB->has_plan

Check if there is a plan

$TB->summary

List of pass/fail results.

EVENT GENERATORS

See Test::Stream::Context, Test::Stream::Toolset, and Test::More::Tools. Calling the methods below is not advised.

$TB->BAILOUT
$TB->BAIL_OUT
$TB->cmp_ok
$TB->current_test
$TB->diag
$TB->done_testing
$TB->is_eq
$TB->is_num
$TB->is_passing
$TB->isnt_eq
$TB->isnt_num
$TB->like
$TB->no_plan
$TB->note
$TB->ok
$TB->plan
$TB->skip
$TB->skip_all
$TB->subtest
$TB->todo_skip
$TB->unlike

ACCESSORS

$TB->stream

Get the stream used by this builder (or the shared stream).

$TB->name

Name of the test

$TB->parent

Parent if this is a child.

AUTHORS

Michael G Schwern <schwern@pobox.com> with much inspiration from Joshua Pritikin's Test module and lots of help from Barrie Slaymaker, Tony Bowden, blackstar.co.uk, chromatic, Fergal Daly and the perl-qa gang.

MAINTAINERS

Chad Granum <exodist@cpan.org>

SOURCE

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

COPYRIGHT

Copyright 2001-2008 by Michael G Schwern <schwern@pobox.com>.

Copyright 2014 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://www.perl.com/perl/misc/Artistic.html