1#!/pro/bin/perl 2 3use strict; 4use warnings; 5 6BEGIN { 7 use Test::More; 8 my $tests = 111; 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}, "Jan 9 2014 09:22:04", "Build time"); 25is ($conf->{config}{version}, "5.18.2", "reconstructed \$Config{version}"); 26 27my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; 28foreach my $o (sort qw( 29 HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV 30 PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP 31 PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_INT 32 USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE 33 USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE 34 USE_PERLIO 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 43is_deeply ($conf->{build}{patches}, [], "No local patches"); 44 45my %check = ( 46 alignbytes => 4, 47 api_version => 18, 48 bincompat5005 => "undef", 49 byteorder => 12345678, 50 cc => "cc", 51 cccdlflags => "-fPIC", 52 ccdlflags => "-Wl,-E", 53 config_args => "-Duse64bitint -Duselongdouble -des", 54 gccversion => "4.8.1 20130909 [gcc-4_8-branch revision 202388]", 55 gnulibc_version => "2.18", 56 ivsize => 8, 57 ivtype => "long long", 58 ld => "cc", 59 lddlflags => "-shared -O2 -L/pro/local/lib -fstack-protector", 60 ldflags => "-L/pro/local/lib -fstack-protector", 61 libc => "/lib/libc-2.18.so", 62 lseektype => "off_t", 63 osvers => "3.11.6-4-desktop", 64 use64bitint => "define", 65 ); 66is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; 67 68__END__ 69Summary of my perl5 (revision 5 version 18 subversion 2) configuration: 70 71 Platform: 72 osname=linux, osvers=3.11.6-4-desktop, archname=i686-linux-64int-ld 73 uname='linux lx09 3.11.6-4-desktop #1 smp preempt wed oct 30 18:04:56 utc 2013 (e6d4a27) i686 i686 i386 gnulinux ' 74 config_args='-Duse64bitint -Duselongdouble -des' 75 hint=recommended, useposix=true, d_sigaction=define 76 useithreads=undef, usemultiplicity=undef 77 useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef 78 use64bitint=define, use64bitall=undef, uselongdouble=define 79 usemymalloc=n, bincompat5005=undef 80 Compiler: 81 cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', 82 optimize='-O2', 83 cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include' 84 ccversion='', gccversion='4.8.1 20130909 [gcc-4_8-branch revision 202388]', gccosandvers='' 85 intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 86 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 87 ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8 88 alignbytes=4, prototype=define 89 Linker and Libraries: 90 ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' 91 libpth=/pro/local/lib /lib /usr/lib /usr/local/lib 92 libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat 93 perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc 94 libc=/lib/libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a 95 gnulibc_version='2.18' 96 Dynamic Linking: 97 dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' 98 cccdlflags='-fPIC', lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector' 99 100 101Characteristics of this binary (from libperl): 102 Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV 103 PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP 104 PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_INT 105 USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE 106 USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE 107 USE_PERLIO USE_PERL_ATOF 108 Built under linux 109 Compiled at Jan 9 2014 09:22:04 110 @INC: 111 /pro/lib/perl5/site_perl/5.18.2/i686-linux-64int-ld 112 /pro/lib/perl5/site_perl/5.18.2 113 /pro/lib/perl5/5.18.2/i686-linux-64int-ld 114 /pro/lib/perl5/5.18.2 115 . 116