1#!/pro/bin/perl 2 3use strict; 4use warnings; 5 6BEGIN { 7 use Test::More; 8 my $tests = 120; 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}, "Nov 19 2015 00:18:50", "Build time"); 25is ($conf->{config}{version}, "5.23.5", "reconstructed \$Config{version}"); 26 27my $opt = Config::Perl::V::plv2hash ("")->{build}{options}; 28foreach my $o (sort qw( 29 HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS 30 PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV 31 PERL_HASH_FUNC_ONE_AT_A_TIME_HARD 32 PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP 33 PERL_PRESERVE_IVUV 34 USE_ITHREADS 35 USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE 36 USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME 37 USE_PERLIO USE_PERL_ATOF 38 )) { 39 is ($conf->{build}{options}{$o}, 1, "Runtime option $o set"); 40 delete $opt->{$o}; 41 } 42foreach my $o (sort keys %$opt) { 43 is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset"); 44 } 45 46eval { require Digest::MD5; }; 47my $md5 = $@ ? "0" x 32 : "bccd5d78dfebd48b89faf7f1fe711733"; 48ok (my $sig = Config::Perl::V::signature ($conf), "Get signature"); 49is ($sig, $md5, "MD5"); 50 51is_deeply ($conf->{build}{patches}, [], "No local patches"); 52 53my %check = ( 54 alignbytes => 8, 55 api_version => 23, 56 bincompat5005 => "undef", 57 byteorder => 1234, 58 cc => "cl", 59 cccdlflags => "", 60 ccdlflags => "", 61 config_args => "undef", 62 gccversion => "", 63 gnulibc_version => "", 64 ivsize => 4, 65 ivtype => "long", 66 ld => "link", 67 lddlflags => q{-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'" -subsystem:console,"5.01"}, 68 ldflags => q{-nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'" -subsystem:console,"5.01"}, 69 libc => "msvcrt.lib", 70 lseektype => "__int64", 71 osvers => "6.1", 72 use64bitall => "undef", 73 use64bitint => "undef", 74 ); 75is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check; 76 77__END__ 78Summary of my perl5 (revision 5 version 23 subversion 5) configuration: 79 80 Platform: 81 osname=MSWin32, osvers=6.1, archname=MSWin32-x86-multi-thread 82 uname='' 83 config_args='undef' 84 hint=recommended, useposix=true, d_sigaction=undef 85 useithreads=define, usemultiplicity=define 86 use64bitint=undef, use64bitall=undef, uselongdouble=undef 87 usemymalloc=n, bincompat5005=undef 88 Compiler: 89 cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS', 90 optimize='-O1 -MD -Zi -DNDEBUG -GL', 91 cppflags='-DWIN32' 92 ccversion='18.00.31101', gccversion='', gccosandvers='' 93 intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3 94 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=0 95 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 96 alignbytes=8, prototype=define 97 Linker and Libraries: 98 ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'" -subsystem:console,"5.01"' 99 libpth=\lib 100 libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib 101 perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib 102 libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl523.lib 103 gnulibc_version='' 104 Dynamic Linking: 105 dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' 106 cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'" -subsystem:console,"5.01"' 107 108 109Characteristics of this binary (from libperl): 110 Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY 111 PERLIO_LAYERS PERL_COPY_ON_WRITE 112 PERL_DONT_CREATE_GVSV 113 PERL_HASH_FUNC_ONE_AT_A_TIME_HARD 114 PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS 115 PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_ITHREADS 116 USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE 117 USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME 118 USE_PERLIO USE_PERL_ATOF 119 Built under MSWin32 120 Compiled at Nov 19 2015 00:18:50 121 @INC: 122 C:/p523/src/lib 123 . 124