xref: /openbsd-src/gnu/usr.bin/perl/cpan/Config-Perl-V/t/28_plv52201w.t (revision e068048151d29f2562a32185e21a8ba885482260)
1#!/pro/bin/perl
2
3use strict;
4use warnings;
5
6BEGIN {
7    use Test::More;
8    my $tests = 126;
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}, "Jun  2 2015 00:03:35", "Build time");
25is ($conf->{config}{version}, "5.22.0", "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_DONT_CREATE_GVSV
31	PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
32	PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP
33	PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
34	USE_64_BIT_INT 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 : "dfb32b8299b66e8bdb2712934f700d94";
48ok (my $sig = Config::Perl::V::signature ($conf), "Get signature");
49
50SKIP: {
51    ord "A" == 65 or skip "ASCII-centric test", 1;
52    is ($sig, $md5, "MD5");
53    }
54
55is_deeply ($conf->{build}{patches}, [], "No local patches");
56
57my %check = (
58    alignbytes      => 8,
59    api_version     => 22,
60    bincompat5005   => "undef",
61    byteorder       => 12345678,
62    cc              => "gcc",
63    cccdlflags      => "",
64    ccdlflags       => "",
65    config_args     => "undef",
66    gccversion      => "4.9.2",
67    gnulibc_version => "",
68    ivsize          => 8,
69    ivtype          => "long long",
70    ld              => "g++",
71    lddlflags       => q{-mdll -s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"},
72    ldflags         => q{-s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"},
73    libc            => "",
74    lseektype       => "long long",
75    osvers          => "6.3",
76    use64bitall     => "undef",
77    use64bitint     => "define",
78    );
79is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check;
80
81__END__
82Summary of my perl5 (revision 5 version 22 subversion 0) configuration:
83
84  Platform:
85    osname=MSWin32, osvers=6.3, archname=MSWin32-x64-multi-thread
86    uname='Win32 strawberry-perl 5.22.0.1 #1 Mon Jun  1 23:58:39 2015 x64'
87    config_args='undef'
88    hint=recommended, useposix=true, d_sigaction=undef
89    useithreads=define, usemultiplicity=define
90    use64bitint=define, use64bitall=undef, uselongdouble=undef
91    usemymalloc=n, bincompat5005=undef
92  Compiler:
93    cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE  -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfields',
94    optimize='-s -O2',
95    cppflags='-DWIN32'
96    ccversion='', gccversion='4.9.2', gccosandvers=''
97    intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
98    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=3
99    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8
100    alignbytes=8, prototype=define
101  Linker and Libraries:
102    ld='g++', ldflags ='-s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"'
103    libpth=D:\Strawberry\c\lib D:\Strawberry\c\x86_64-w64-mingw32\lib D:\Strawberry\c\lib\gcc\x86_64-w64-mingw32\4.9.2
104    libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
105 -lcomctl32
106    perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbc
107cp32 -lcomctl32
108    libc=, so=dll, useshrplib=true, libperl=libperl522.a
109    gnulibc_version=''
110  Dynamic Linking:
111    dlsrc=dl_win32.xs, dlext=xs.dll, d_dlsymun=undef, ccdlflags=' '
112    cccdlflags=' ', lddlflags='-mdll -s -L"D:\Strawberry\perl\lib\CORE" -L"D:\Strawberry\c\lib"'
113
114
115Characteristics of this binary (from libperl):
116  Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY
117                        PERLIO_LAYERS PERL_DONT_CREATE_GVSV
118                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
119                        PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
120                        PERL_MALLOC_WRAP PERL_NEW_COPY_ON_WRITE
121                        PERL_PRESERVE_IVUV USE_64_BIT_INT USE_ITHREADS
122                        USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
123                        USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
124                        USE_PERLIO USE_PERL_ATOF
125  Built under MSWin32
126  Compiled at Jun  2 2015 00:03:35
127  @INC:
128    D:/Strawberry/perl/site/lib
129    D:/Strawberry/perl/vendor/lib
130    D:/Strawberry/perl/lib
131    .
132