1 # (X)Emacs mode: -*- cperl -*-
7 test - tools for helping in test suites (not including running externalprograms).
12 open my $fh, '>', 'foo';
14 for 'Bulgaria', 'Cholet';
16 }, 'write foo'), 1, 'write foo';
20 This package provides some variables, and sets up an environment, for test
21 scripts, such as those used in F<t/>.
23 This package does not including running external programs; that is provided by
24 C<test2.pm>. This is so that suites not needing that can include only
25 test.pm, and so not require the presence of C<IPC::Run>.
27 Setting up the environment includes:
31 =item Prepending F<blib/script> onto the path
33 =item Pushing the module F<lib/> dir onto the @INC var
35 For internal C<use> calls.
37 =item Changing directory to a temporary directory
39 To avoid cluttering the local dir, and/or allowing the local directory
40 structure to affect matters.
42 =item Cleaning up the temporary directory afterwards
44 Unless TEST_DEBUG is set in the environment.
50 # ----------------------------------------------------------------------------
52 # Pragmas -----------------------------
56 use vars qw( @EXPORT_OK );
58 # Inheritance -------------------------
60 use base qw( Exporter );
64 The following symbols are exported upon request:
74 @EXPORT_OK = qw( evcheck );
76 # Utility -----------------------------
83 # -------------------------------------
85 # -------------------------------------
89 Eval code, return status
103 Name to use in error messages
113 1 if eval was okay, 0 if not.
122 my ($code, $name) = @_;
130 carp "Code $name failed: $@\n"
138 # -------------------------------------
140 # defined further up to use in constants
142 # ----------------------------------------------------------------------------
152 =head1 REPORTING BUGS
158 Martyn J. Pearce C<fluffy@cpan.org>
162 Copyright (c) 2001, 2002, 2004 Martyn J. Pearce. This program is free
163 software; you can redistribute it and/or modify it under the same terms as
172 1; # keep require happy.