This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
POSIX.xs: Never pass NULL to ctermid()
[perl5.git] / cpan / IO-Compress / t / 000prereq.t
1 BEGIN {
2     if ($ENV{PERL_CORE}) {
3         chdir 't' if -d 't';
4         @INC = ("../lib", "lib/compress");
5     }
6 }
7
8 use lib qw(t t/compress);
9 use strict ;
10 use warnings ;
11
12 use Test::More ;
13
14 sub gotScalarUtilXS
15 {
16     eval ' use Scalar::Util "dualvar" ';
17     return $@ ? 0 : 1 ;
18 }
19
20 BEGIN
21 {
22     # use Test::NoWarnings, if available
23     my $extra = 0 ;
24     $extra = 1
25         if eval { require Test::NoWarnings ;  import Test::NoWarnings; 1 };
26
27
28     my $VERSION = '2.093';
29     my @NAMES = qw(
30                         Compress::Raw::Bzip2
31                         Compress::Raw::Zlib
32
33                         Compress::Zlib
34
35             IO::Compress::Adapter::Bzip2
36             IO::Compress::Adapter::Deflate
37             IO::Compress::Adapter::Identity
38             IO::Compress::Base::Common
39             IO::Compress::Base
40             IO::Compress::Bzip2
41             IO::Compress::Deflate
42             IO::Compress::Gzip::Constants
43             IO::Compress::Gzip
44             IO::Compress::RawDeflate
45             IO::Compress::Zip::Constants
46             IO::Compress::Zip
47             IO::Compress::Zlib::Constants
48             IO::Compress::Zlib::Extra
49             IO::Uncompress::Adapter::Bunzip2
50             IO::Uncompress::Adapter::Identity
51             IO::Uncompress::Adapter::Inflate
52             IO::Uncompress::AnyInflate
53             IO::Uncompress::AnyUncompress
54             IO::Uncompress::Base
55             IO::Uncompress::Bunzip2
56             IO::Uncompress::Gunzip
57             IO::Uncompress::Inflate
58             IO::Uncompress::RawInflate
59             IO::Uncompress::Unzip
60
61                         );
62
63     my @OPT = qw(                       
64                         );
65
66     plan tests => 1 + 2 + @NAMES + @OPT + $extra ;
67
68     foreach my $name (@NAMES)
69     {
70         use_ok($name, $VERSION);
71     }
72
73
74     foreach my $name (@OPT)
75     {
76         eval " require $name " ;
77         if ($@)
78         {
79             ok 1, "$name not available" 
80         }
81         else  
82         {
83             my $ver = eval("\$${name}::VERSION");
84             is $ver, $VERSION, "$name version should be $VERSION" 
85                 or diag "$name version is $ver, need $VERSION" ;
86         }         
87     }
88
89     # need zlib 1.2.0 or better
90     
91     cmp_ok Compress::Raw::Zlib::ZLIB_VERNUM(), ">=", 0x1200
92         or diag "IO::Compress needs zlib 1.2.0 or better, you have " . Compress::Raw::Zlib::zlib_version(); 
93     
94     use_ok('Scalar::Util') ;
95
96 }
97
98 ok gotScalarUtilXS(), "Got XS Version of Scalar::Util"
99     or diag <<EOM;
100 You don't have the XS version of Scalar::Util
101 EOM
102