This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tweak to make it clearer what to do if your working space is dirty
[perl5.git] / cpan / Compress-Raw-Zlib / t / 01version.t
CommitLineData
25f0751f
PM
1BEGIN {
2 if ($ENV{PERL_CORE}) {
3 chdir 't' if -d 't';
4 @INC = ("../lib", "lib/compress");
5 }
6}
7
8use lib qw(t t/compress);
9use strict ;
10use warnings ;
11
12use Test::More ;
13
14BEGIN
15{
16 # use Test::NoWarnings, if available
17 my $extra = 0 ;
18 $extra = 1
19 if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
20
21 plan tests => 2 + $extra ;
22
23 use_ok('Compress::Raw::Zlib', 2) ;
24}
25
26# Check zlib_version and ZLIB_VERSION are the same.
27
f02c02ec
CBW
28SKIP: {
29 skip "TEST_SKIP_VERSION_CHECK is set", 1
30 if $ENV{TEST_SKIP_VERSION_CHECK};
31 my $zlib_h = ZLIB_VERSION ;
32 my $libz = Compress::Raw::Zlib::zlib_version;
25f0751f 33
f02c02ec
CBW
34 is($zlib_h, $libz, "ZLIB_VERSION ($zlib_h) matches Compress::Raw::Zlib::zlib_version")
35 or diag <<EOM;
25f0751f
PM
36
37The version of zlib.h does not match the version of libz
38
39You have zlib.h version $zlib_h
40 and libz version $libz
41
42You probably have two versions of zlib installed on your system.
43Try removing the one you don't want to use and rebuild.
44EOM
f02c02ec 45}
25f0751f 46