1#!/pro/bin/perl 2 3use strict; 4use warnings; 5 6BEGIN { 7 use Test::More; 8 my $tests = 106; 9 unless ($ENV{PERL_CORE}) { 10 require Test::NoWarnings; 11 Test::NoWarnings->import (); 12 $tests++; 13 } 14 15 plan tests => $tests; 16 } 17 18use Config::Perl::V; 19 20ok (my $conf = Config::Perl::V::plv2hash (<DATA>), "Read perl -v block"); 21ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc ); 22 23is ($conf->{build}{osname}, $conf->{config}{osname}, "osname"); 24is ($conf->{build}{stamp}, "Mar 12 2013 08:36:17", "Build time"); 25is ($conf->{config}{version}, "5.16.3", "reconstructed \%Config{version}"); 26is ($conf->{config}{ccversion}, "", "Using gcc. non-gcc version should not be defined"); 27 28my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; 29foreach my $o (sort qw( 30 HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV 31 PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_INT 32 USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE 33 USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO 34 USE_PERL_ATOF 35 )) { 36 is ($conf->{build}{options}{$o}, 1, "Runtime option $o set"); 37 delete $opt->{$o}; 38 } 39foreach my $o (sort keys %$opt) { 40 is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset"); 41 } 42 43eval { require Digest::MD5; }; 44my $md5 = $@ ? "0" x 32 : "7b00cf3b306d96fa802892e6ad4b070f"; 45ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); 46 47SKIP: { 48 ord "A" == 65 or skip "ASCII-centric test", 1; 49 is ($sig, $md5, "MD5"); 50 } 51 52__END__ 53Summary of my perl5 (revision 5 version 16 subversion 3) configuration: 54 55 Platform: 56 osname=linux, osvers=3.4.33-2.24-desktop, archname=i686-linux-64int 57 uname='linux lx09 3.4.33-2.24-desktop #1 smp preempt tue feb 26 03:34:33 utc 2013 (5f00a32) i686 i686 i386 gnulinux ' 58 config_args='-Duse64bitint -Duselongdouble -des' 59 hint=previous, useposix=true, d_sigaction=define 60 useithreads=undef, usemultiplicity=undef 61 useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef 62 use64bitint=define, use64bitall=undef, uselongdouble=undef 63 usemymalloc=n, bincompat5005=undef 64 Compiler: 65 cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', 66 optimize='-O2', 67 cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' 68 ccversion='', gccversion='4.7.1 20120723 [gcc-4_7-branch revision 189773]', gccosandvers='' 69 intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 70 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 71 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 72 alignbytes=4, prototype=define 73 Linker and Libraries: 74 ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' 75 libpth=/pro/local/lib /lib /usr/lib /usr/local/lib 76 libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat 77 perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc 78 libc=/lib/libc-2.15.so, so=so, useshrplib=false, libperl=libperl.a 79 gnulibc_version='2.15' 80 Dynamic Linking: 81 dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' 82 cccdlflags='-fPIC', lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector' 83 84 85Characteristics of this binary (from libperl): 86 Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV 87 PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_INT 88 USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE 89 USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO 90 USE_PERL_ATOF 91 Built under linux 92 Compiled at Mar 12 2013 08:36:17 93 @INC: 94 /pro/lib/perl5/site_perl/5.16.3/i686-linux-64int 95 /pro/lib/perl5/site_perl/5.16.3 96 /pro/lib/perl5/5.16.3/i686-linux-64int 97 /pro/lib/perl5/5.16.3 98 . 99