Acme-FSM
view release on metacpan or search on metacpan
t/TestSuite.pm view on Meta::CPAN
# $Id: TestSuite.pm 564 2025-02-13 21:33:15Z whynot $
# Copyright 2012, 2013, 2022 Eric Pozharski <whynot@pozharski.name>
# Copyright 2025 Eric Pozharski <wayside.ultimate@tuta.io>
# GNU LGPLv3
# AS-IS, NO-WARRANTY, HOPE-TO-BE-USEFUL
# qmdP Wc1x TJXv nTKr MbJk korM rYp3 zo57 DSKU kGG4 YES1 YgDi N1Xl wzqw 3HbC Y5xM Mn2s 6iIU fYQc UYWm nUF2 t1OM S675 6fg6 XOki d2hO |
use strict;
use warnings;
package t::TestSuite;
use version 0.77; our $VERSION = version->declare( v2.3.4 );
use base qw| Exporter |;
# XXX:202212222241:whynot: B<&AFSMTS_dump> isn't in use by unit-tests. Also has cookoo dependency omitted from I<build_requires>. Hmm.
our %EXPORT_TAGS =
( diag => [qw| &AFSMTS_diag &AFSMTS_dump &AFSMTS_croakson |],
utils => [qw| &AFSMTS_smartmatch &AFSMTS_grep |],
run =>
[qw| &AFSMTS_wrap &AFSMTS_croakson &AFSMTS_deeply &AFSMTS_shift |],
wraps =>
[qw| &AFSMTS_class_wrap &AFSMTS_object_wrap &AFSMTS_method_wrap |],
switches =>
[qw| &AFSMTS_U &AFSMTS_Uk &AFSMTS_F &AFSMTS_FK &AFSMTS_T
&AFSMTS_TK &AFSMTS_t &AFSMTS_tK &AFSMTS_D &AFSMTS_E
&AFSMTS_EK |] );
our @EXPORT_OK = ( map @$_, values %EXPORT_TAGS );
use Module::Build;
use Carp qw| croak |;
=head1 NAME
TestSuite.pm - service routines of Acme::FSM build
=head1 ACCESSORIES
=over
=item I<$t::TestSuite::build>
$t::TestSuite::build->notes( 'should_i_die' ) and die;
Provides access to current build.
=cut
our $build = Module::Build->current;
=item I<$t::TestSuite::NO_TRIM>
$t::TestSuite::NO_TRIM = 1;
Forbids trimming I<$main::stderr>.
=cut
our $NO_TRIM;
=back
=cut
=head1 FUNCTIONS
=over
=item B<AFSMTS_diag()>
use t::TestSuite qw/ :diag /;
AFSMTS_diag $@
Outputs through B<Test::More::diag()>.
Void if I<STDOUT> isa not terminal, I<$ENV{QUIET}> is TRUE, I<@_> is empty, or
I<@_> consists of FALSEs.
=cut
sub AFSMTS_diag ( @ ) {
-t STDOUT && !$ENV{QUIET} && @_ && grep $_, @_ or return;
Test::More::diag( @_ ) }
=item B<AFSMTS_dump()>
use t::TestSuite qw/ :diag /;
AFSMTS_dump $@
( run in 1.168 second using v1.01-cache-2.11-cpan-39bf76dae61 )