File: abeltje.pm

package info (click to toggle)
libv-perl 0.22-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192 kB
  • sloc: perl: 556; makefile: 2
file content (82 lines) | stat: -rw-r--r-- 1,712 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/perl

package t::Test::abeltje;

use 5.014000;
use strict;
use warnings;

our $VERSION = "1.09";

use parent "Test::Builder::Module";

use Test::Builder::Module;
use Test::More;
use Test::Fatal    qw( exception success dies_ok lives_ok );
use Test::Warnings qw( :all );

our @EXPORT = (
    "abeltje_done_testing",

    @Test::More::EXPORT,
    @Test::Fatal::EXPORT_OK,
    @Test::Warnings::EXPORT_OK,
    );

sub import_extra {
    # use Test::Warnings 'warnings' interferes
    # with warnings->import()
    warnings::import ("warnings");
    strict->import ();

    require feature;
    feature->import (":5.10");

    require lib;
    lib->import ("t/lib");

    $Devel::Cover::VERSION and    # don't run_end_test when Devel::Cover
	Test::Warnings->import (":no_end_test");
    $ENV{AUTHOR_TESTING} or
	Test::Warnings->import (":no_end_test");
    }

*abeltje_done_testing = \&Test::More::done_testing;

1;

=head1 NAME

t::Test::abeltje - Helper Test module that imports useful stuff.

=head1 SYNOPSIS

    #! perl -I.
    use t::Test::abeltje;

    # Do not forget -I. on the shebang line
    # this is where you have your Fav. test-routines.

    abeltje_done_testing ();

=head1 DESCRIPTION

Mostly nicked from other modules (like L<Modern::Perl>)...

This gives you L<Test::More>, L<Test::Fatal>, L<Test::Warnings> and also imports
for you: L<strict>, L<warnings>, the L<feature> with the C<:5.10> tag and L<lib>
with the C<t/lib> path.

=head2 abeltje_done_testing

Just for fun, an alias for L<Test::More/done_testing()>.

=head2 import_extra

This module works by the use of L<Test::Builder::Module/import_extra()>.

=head1 COPYRIGHT

E<copy> MMXX - Abe Timmerman <abeltje@cpan.org>

=cut