1 # (X)Emacs mode: -*- cperl -*-
7 test - tools for helping in test suites (not including running externalprograms).
11 use FindBin 1.42 qw( $Bin );
12 use Test 1.13 qw( ok plan );
14 BEGIN { unshift @INC, $Bin };
16 use test qw( evcheck runcheck );
25 open my $fh, '>', 'foo';
27 for 'Bulgaria', 'Cholet';
29 }, 'write foo'), 1, 'write foo';
33 This package provides some variables, and sets up an environment, for test
34 scripts, such as those used in F<t/>.
36 This package does not including running external programs; that is provided by
37 C<test2.pm>. This is so that suites not needing that can include only
38 test.pm, and so not require the presence of C<IPC::Run>.
40 Setting up the environment includes:
44 =item Prepending F<blib/script> onto the path
46 =item Pushing the module F<lib/> dir onto the @INC var
48 For internal C<use> calls.
50 =item Changing directory to a temporary directory
52 To avoid cluttering the local dir, and/or allowing the local directory
53 structure to affect matters.
55 =item Cleaning up the temporary directory afterwards
57 Unless TEST_DEBUG is set in the environment.
63 # ----------------------------------------------------------------------------
65 # Pragmas -----------------------------
69 use vars qw( @EXPORT_OK );
71 # Inheritance -------------------------
73 use base qw( Exporter );
77 The following symbols are exported upon request:
87 @EXPORT_OK = qw( evcheck );
89 # Utility -----------------------------
96 # -------------------------------------
98 # -------------------------------------
102 Eval code, return status
116 Name to use in error messages
126 1 if eval was okay, 0 if not.
135 my ($code, $name) = @_;
143 carp "Code $name failed: $@\n"
151 # -------------------------------------
153 # defined further up to use in constants
155 # ----------------------------------------------------------------------------
165 =head1 REPORTING BUGS
171 Martyn J. Pearce C<fluffy@cpan.org>
175 Copyright (c) 2001, 2002, 2004 Martyn J. Pearce. This program is free
176 software; you can redistribute it and/or modify it under the same terms as
185 1; # keep require happy.