X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=t%2Ftest.pm;h=fb2e334bf036995295b08bf8b3a15e33cda6b25a;hb=d5721c97e419a66eb174f90b91ab1431b58ee075;hp=6d812497c2443e8e3134ec13939a29687bce28a4;hpb=8d5ca793118d34dc24e4790142811f56d16efa5e;p=term-progressbar.git diff --git a/t/test.pm b/t/test.pm index 6d81249..fb2e334 100644 --- a/t/test.pm +++ b/t/test.pm @@ -13,8 +13,7 @@ test - tools for helping in test suites (not including running externalprograms) BEGIN { unshift @INC, $Bin }; - use test qw( DATA_DIR - evcheck runcheck ); + use test qw( evcheck runcheck ); BEGIN { plan tests => 3, @@ -48,10 +47,6 @@ Setting up the environment includes: =item Prepending F onto the path -=item Pushing the module F dir onto the @PERL5LIB var - -For executed scripts. - =item Pushing the module F dir onto the @INC var For internal C calls. @@ -87,16 +82,6 @@ The following symbols are exported upon request: =over 4 -=item BIN_DIR - -=item DATA_DIR - -=item REF_DIR - -=item LIB_DIR - -=item PERL - =item check_req =item compare @@ -115,21 +100,18 @@ The following symbols are exported upon request: =item find_exec -=item read_file - =back =cut -@EXPORT_OK = qw( BIN_DIR DATA_DIR REF_DIR LIB_DIR PERL - check_req compare evcheck find_exec only_files read_file +@EXPORT_OK = qw( check_req compare evcheck only_files save_output restore_output tempdir tmpnam ); # Utility ----------------------------- use Carp qw( carp croak ); use Cwd 2.01 qw( cwd ); -use Env qw( PATH PERL5LIB ); +use Env qw( PATH ); use Fatal 1.02 qw( close open seek sysopen unlink ); use Fcntl 1.03 qw( :DEFAULT ); use File::Basename qw( basename ); @@ -178,11 +160,6 @@ sub min { # PACKAGE CONSTANTS # ------------------------------------- -use constant BIN_DIR => catdir $Bin, updir, 'bin'; -use constant DATA_DIR => catdir $Bin, updir, 'data'; -use constant REF_DIR => catdir $Bin, updir, 'testref'; -use constant LIB_DIR => catdir $Bin, updir, 'lib'; - use constant BUILD_SCRIPT_DIR => => catdir $Bin, updir, qw( blib script ); sub find_exec { @@ -196,19 +173,10 @@ sub find_exec { return; } -use constant PERL => (basename($^X) eq $^X ? - find_exec($^X) : - rel2abs($^X)); - # ------------------------------------- # PACKAGE ACTIONS # ------------------------------------- -# @PERL5LIB not available in Env for perl 5.00503 -# unshift @PERL5LIB, LIB_DIR; -$PERL5LIB = defined $PERL5LIB ? join(':', LIB_DIR, $PERL5LIB) : LIB_DIR; -unshift @INC, LIB_DIR; - $PATH = join ':', BUILD_SCRIPT_DIR, split /:/, $PATH; $_ = rel2abs($_) @@ -1091,56 +1059,6 @@ nothing, if no such file exists. # defined further up to use in constants -# ------------------------------------- - -=head2 read_file - -=over 4 - -=item ARGUMENTS - -=over 4 - -=item filename - -B - -=item line-terminator - -B. Value of C<$/>. Defaults to C<"\n">. - -=back - -=item RETURNS - -=over 4 - -=item lines - -A list of lines in the file (lines determined by the value of -line-terminator), as an arrayref. - -=back - -=back - -=cut - -sub read_file { - my ($fn, $term) = @_; - - $term = "\n" - unless defined $term; - - my $fh = do { local *F; *F }; - sysopen $fh, $fn, O_RDONLY; - local $/ = $term; - my @lines = <$fh>; - close $fh; - - return \@lines; -} - # ---------------------------------------------------------------------------- =head1 EXAMPLES