DEPRECATED

***INTERNALS NOTE***

The internals of this package are subject to change at any time! The public methods provided will not change in backwords incompatible ways, but the underlying implementation details might. Do not break encapsulation here!

DESCRIPTION

There is a need to synchronize some details for all tests that run. This package stores these global objects. As little as possible is kept here, when possible things should not be global.

Set the global formatter class. This can only be set once. Note: This will override anything specified in the 'TS_FORMATTER' environment variable.

$bool = Test::Stream::Sync->no_wait

Test::Stream::Sync->no_wait($bool)

This can be used to get/set the no_wait status. Waiting is turned on by default. Waiting will cause the parent process/thread to wait until all child processes and threads are finished before exiting. You will almost never want to turn this off.

Test::Stream::Sync->add_hook(sub { ... })

This can be used to add a hook that is called after all testing is done. This is too late to add additional results, the main use of this hook is to set the exit code.

The $context passed in will be an instance of Test::Stream::Context. The $exit argument will be the original exit code before anything modified it. $$new_exit is a reference to the new exit code. You may modify this to change the exit code. Please note that $$new_exit may already be different from $exit

Test::Stream::Sync->post_load(sub { ... })

Add a callback that will be called when Test::Stream is finished loading. This means the callback will be run when Test::Stream is done loading all the plugins in your use statement. If Test::Stream has already finished loading then the callback will be run immedietly.

$bool = Test::Stream::Sync->loaded

Test::Stream::Sync->loaded($true)

Without arguments this will simply return the boolean value of the loaded flag. If Test::Stream has finished loading this will be true, otherwise false. If a true value is provided as an argument then this will set the flag to true, and run all post_load callbacks. The second form should ONLY ever be used in Test::Stream or alternative loader modules.

MAGIC

This package has an END block. This END block is responsible for setting the exit code based on the test results. This end block also calls the hooks that can be added to this package.

SOURCE

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

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright 2015 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/

Module Install Instructions

To install Test::Stream::Sync, simply copy and paste either of the commands in to your terminal

As a valued partner and proud supporter of MetaCPAN, StickerYou is
happy to offer a 10% discount on all Custom Stickers,
Business Labels, Roll Labels,
Vinyl Lettering or Custom Decals. StickerYou.com
is your one-stop shop to make your business stick.
Use code METACPAN10 at checkout to apply your discount.