Compress-Raw-Zlib

 view release on metacpan or  search on metacpan

t/compress/CompTestUtils.pm  view on Meta::CPAN

}

sub test_zlib_header_matches_library
{
SKIP: {
    skip "TEST_SKIP_VERSION_CHECK is set", 1
        if $ENV{TEST_SKIP_VERSION_CHECK};

    if (Compress::Raw::Zlib::is_zlibng_native())
    {
        my $zlibng_h = Compress::Raw::Zlib::ZLIBNG_VERSION ;
        my $libzng   = Compress::Raw::Zlib::zlibng_version();
        is($zlibng_h, $libzng, "ZLIBNG_VERSION ($zlibng_h) matches Compress::Raw::Zlib::zlibng_version")
            or diag <<EOM;

The version of zlib-ng.h does not match the version of libz-ng

You have zlib-ng.h version $zlibng_h
     and libz-ng   version $libzng

You probably have two versions of zlib-ng installed on your system.
Try removing the one you don't want to use and rebuild.
EOM
    }
    else
    {
        my $zlib_h = ZLIB_VERSION ;
        my $libz   = Compress::Raw::Zlib::zlib_version();
        is($zlib_h, $libz, "ZLIB_VERSION ($zlib_h) matches Compress::Raw::Zlib::zlib_version")
            or diag <<EOM;

The version of zlib.h does not match the version of libz

You have zlib.h version $zlib_h
     and libz   version $libz

You probably have two versions of zlib installed on your system.
Try removing the one you don't want to use and rebuild.
EOM
    }
    }
}


{
    package LexFile ;

    our ($index);
    $index = '00000';

    sub new
    {
        my $self = shift ;
        foreach (@_)
        {
            Carp::croak "NO!!!!" if defined $_;
            # autogenerate the name if none supplied
            $_ = "tst" . $$ . "X" . $index ++ . ".tmp"
                unless defined $_;
        }
        chmod 0777, @_;
        for (@_) { 1 while unlink $_ } ;
        bless [ @_ ], $self ;
    }

    sub DESTROY
    {
        my $self = shift ;
        chmod 0777, @{ $self } ;
        for (@$self) { 1 while unlink $_ } ;
    }

}

{
    package LexDir ;

    use File::Path;

    our ($index);
    $index = '00000';
    our ($useTempFile);
    our ($useTempDir);

    sub new
    {
        my $self = shift ;

        if ( $useTempDir)
        {
            foreach (@_)
            {
                Carp::croak "NO!!!!" if defined $_;
                $_ = File::Temp->newdir(DIR => '.');
                # Subsequent manipulations assume Unix syntax, metacharacters, etc.
                if ($^O eq 'VMS')
                {
                    $_->{DIRNAME} = VMS::Filespec::unixify($_->{DIRNAME});
                    $_->{DIRNAME} =~ s/\/$//;
                }
            }
            bless [ @_ ], $self ;
        }
        elsif ( $useTempFile)
        {
            foreach (@_)
            {
                Carp::croak "NO!!!!" if defined $_;
                $_ = File::Temp::tempdir(DIR => '.', CLEANUP => 1);
                # Subsequent manipulations assume Unix syntax, metacharacters, etc.
                if ($^O eq 'VMS')
                {
                    $_ = VMS::Filespec::unixify($_);
                    $_ =~ s/\/$//;
                }
            }
            bless [ @_ ], $self ;
        }
        else
        {
            foreach (@_)
            {
                Carp::croak "NO!!!!" if defined $_;
                # autogenerate the name if none supplied
                $_ = "tmpdir" . $$ . "X" . $index ++ . ".tmp" ;
            }
            foreach (@_)
            {
                rmtree $_, {verbose => 0, safe => 1}



( run in 0.832 second using v1.01-cache-2.11-cpan-39bf76dae61 )