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}, "Oct 21 2010 14:50:53", "Build time"); 25is ($conf->{config}{version}, "5.8.9", "reconstructed \%Config{version}"); 26is ($conf->{config}{usethreads}, "define", "This was a threaded perl"); 27 28my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; 29foreach my $o (sort qw( 30 DEBUGGING MULTIPLICITY PERL_IMPLICIT_CONTEXT 31 PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_64_BIT_INT 32 USE_FAST_STDIO USE_ITHREADS USE_LARGE_FILES 33 USE_LONG_DOUBLE USE_PERLIO USE_REENTRANT_API 34 )) { 35 is ($conf->{build}{options}{$o}, 1, "Runtime option $o set"); 36 delete $opt->{$o}; 37 } 38foreach my $o (sort keys %$opt) { 39 is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset"); 40 } 41 42eval { require Digest::MD5; }; 43my $md5 = $@ ? "0" x 32 : "df48dce1adaaf63855d8acd455c51818"; 44ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); 45 46SKIP: { 47 ord "A" == 65 or skip "ASCII-centric test", 1; 48 is ($sig, $md5, "MD5"); 49 } 50 51__END__ 52Summary of my perl5 (revision 5 version 8 subversion 9) configuration: 53 Platform: 54 osname=linux, osvers=2.6.34.7-0.4-desktop, archname=i686-linux-thread-multi-64int-ld 55 uname='linux tux09.procura.nl 2.6.34.7-0.4-desktop #1 smp preempt 2010-10-07 19:07:51 +0200 i686 i686 i386 gnulinux ' 56 config_args='-Dusedevel -Dusethreads -Duseithreads -Duse64bitint -Duselongdouble -Duseperlio -des -Dusedevel -Uinstallusrbinperl -Dprefix=/media/Tux/perls-t' 57 hint=recommended, useposix=true, d_sigaction=define 58 usethreads=define use5005threads=undef useithreads=define usemultiplicity=define 59 useperlio=define d_sfio=undef uselargefiles=define usesocks=undef 60 use64bitint=define use64bitall=undef uselongdouble=define 61 usemymalloc=n, bincompat5005=undef 62 Compiler: 63 cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', 64 optimize='-O2', 65 cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -pipe -I/pro/local/include' 66 ccversion='', gccversion='4.5.0 20100604 [gcc-4_5-branch revision 160292]', gccosandvers='' 67 intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 68 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 69 ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8 70 alignbytes=4, prototype=define 71 Linker and Libraries: 72 ld='cc', ldflags ='-L/pro/local/lib' 73 libpth=/pro/local/lib /lib /usr/lib /usr/local/lib 74 libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc 75 perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc 76 libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a 77 gnulibc_version='2.11.2' 78 Dynamic Linking: 79 dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' 80 cccdlflags='-fPIC', lddlflags='-shared -O2 -L/pro/local/lib' 81 82 83Characteristics of this binary (from libperl): 84 Compile-time options: DEBUGGING MULTIPLICITY PERL_IMPLICIT_CONTEXT 85 PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_64_BIT_INT 86 USE_FAST_STDIO USE_ITHREADS USE_LARGE_FILES 87 USE_LONG_DOUBLE USE_PERLIO USE_REENTRANT_API 88 Built under linux 89 Compiled at Oct 21 2010 14:50:53 90 @INC: 91 /media/Tux/perls-t/lib/5.8.9/i686-linux-thread-multi-64int-ld 92 /media/Tux/perls-t/lib/5.8.9 93 /media/Tux/perls-t/lib/site_perl/5.8.9/i686-linux-thread-multi-64int-ld 94 /media/Tux/perls-t/lib/site_perl/5.8.9 95 . 96