xref: /openbsd-src/gnu/usr.bin/perl/cpan/Config-Perl-V/t/40_plv5358dnqm.t (revision f2a19305cfc49ea4d1a5feb55cd6c283c6f1e031)
1*f2a19305Safresh1#!/pro/bin/perl
2*f2a19305Safresh1
3*f2a19305Safresh1use strict;
4*f2a19305Safresh1use warnings;
5*f2a19305Safresh1
6*f2a19305Safresh1BEGIN {
7*f2a19305Safresh1    use Test::More;
8*f2a19305Safresh1    my $tests = 134;
9*f2a19305Safresh1    unless ($ENV{PERL_CORE}) {
10*f2a19305Safresh1	require Test::NoWarnings;
11*f2a19305Safresh1	Test::NoWarnings->import ();
12*f2a19305Safresh1	$tests++;
13*f2a19305Safresh1	}
14*f2a19305Safresh1
15*f2a19305Safresh1    plan tests => $tests;
16*f2a19305Safresh1    }
17*f2a19305Safresh1
18*f2a19305Safresh1use Config::Perl::V qw( summary );
19*f2a19305Safresh1
20*f2a19305Safresh1ok (my $conf = Config::Perl::V::plv2hash (<DATA>), "Read perl -v block");
21*f2a19305Safresh1ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc );
22*f2a19305Safresh1
23*f2a19305Safresh1is ($conf->{build}{osname}, $conf->{config}{osname}, "osname");
24*f2a19305Safresh1is ($conf->{build}{stamp}, "Jan  1 2022 11:18:27", "Build time");
25*f2a19305Safresh1is ($conf->{config}{version}, "5.35.8", "reconstructed \$Config{version}");
26*f2a19305Safresh1
27*f2a19305Safresh1my $opt = Config::Perl::V::plv2hash ("")->{build}{options};
28*f2a19305Safresh1foreach my $o (sort qw(
29*f2a19305Safresh1	HAS_TIMES PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV
30*f2a19305Safresh1	PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV PERL_USE_DEVEL
31*f2a19305Safresh1	USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE
32*f2a19305Safresh1	USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC
33*f2a19305Safresh1	USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF USE_QUADMATH
34*f2a19305Safresh1	)) {
35*f2a19305Safresh1    is ($conf->{build}{options}{$o}, 1, "Runtime option $o set");
36*f2a19305Safresh1    delete $opt->{$o};
37*f2a19305Safresh1    }
38*f2a19305Safresh1foreach my $o (sort keys %$opt) {
39*f2a19305Safresh1    is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset");
40*f2a19305Safresh1    }
41*f2a19305Safresh1
42*f2a19305Safresh1eval { require Digest::MD5; };
43*f2a19305Safresh1my $md5 = $@ ? "0" x 32 : "3a52d65d54ee1032f878b51fb20c8efd";
44*f2a19305Safresh1ok (my $sig = Config::Perl::V::signature ($conf), "Get signature");
45*f2a19305Safresh1is ($sig, $md5, "MD5");
46*f2a19305Safresh1
47*f2a19305Safresh1is_deeply ($conf->{build}{patches}, [ ], "No patches");
48*f2a19305Safresh1
49*f2a19305Safresh1my %check = (
50*f2a19305Safresh1    alignbytes      => 16,
51*f2a19305Safresh1    api_version     => 35,
52*f2a19305Safresh1    bincompat5005   => undef,
53*f2a19305Safresh1    byteorder       => 12345678,
54*f2a19305Safresh1    cc              => "cc",
55*f2a19305Safresh1    cccdlflags      => "-fPIC",
56*f2a19305Safresh1    ccdlflags       => "-Wl,-E",
57*f2a19305Safresh1    config_args     => "-Dusedevel -Duse64bitall -Dusequadmath -Uuseperlio -des",
58*f2a19305Safresh1    gccversion      => "11.2.1 20211124 [revision 7510c23c1ec53aa4a62705f0384079661342ff7b]",
59*f2a19305Safresh1    gnulibc_version => "2.34",
60*f2a19305Safresh1    ivsize          => 8,
61*f2a19305Safresh1    ivtype          => "long",
62*f2a19305Safresh1    ld              => "cc",
63*f2a19305Safresh1    lddlflags       => "-shared -O2 -L/pro/local/lib -fstack-protector-strong",
64*f2a19305Safresh1    ldflags         => "-L/pro/local/lib -fstack-protector-strong",
65*f2a19305Safresh1    libc            => "/lib/../lib64/libc.so.6",
66*f2a19305Safresh1    lseektype       => "off_t",
67*f2a19305Safresh1    osvers          => "5.15.8-1-default",
68*f2a19305Safresh1    use64bitall     => "define",
69*f2a19305Safresh1    use64bitint     => "define",
70*f2a19305Safresh1    usemymalloc     => "n",
71*f2a19305Safresh1    default_inc_excludes_dot
72*f2a19305Safresh1		    => "define",
73*f2a19305Safresh1    );
74*f2a19305Safresh1is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check;
75*f2a19305Safresh1
76*f2a19305Safresh1ok (my $info = summary ($conf), "A summary");
77*f2a19305Safresh1ok (exists $info->{$_}, "Summary has $_") for qw( cc config_args usemymalloc default_inc_excludes_dot );
78*f2a19305Safresh1is ($info->{default_inc_excludes_dot}, "define", "This build has . NOT in INC");
79*f2a19305Safresh1
80*f2a19305Safresh1__END__
81*f2a19305Safresh1Summary of my perl5 (revision 5 version 35 subversion 8) configuration:
82*f2a19305Safresh1  Snapshot of: 0ccfd062e2cfd32efe146d4c16faf3cae9e3cc84
83*f2a19305Safresh1  Platform:
84*f2a19305Safresh1    osname=linux
85*f2a19305Safresh1    osvers=5.15.8-1-default
86*f2a19305Safresh1    archname=x86_64-linux-quadmath
87*f2a19305Safresh1    uname='linux lx09 5.15.8-1-default #1 smp wed dec 15 08:12:54 utc 2021 (0530e5c) x86_64 x86_64 x86_64 gnulinux '
88*f2a19305Safresh1    config_args='-Dusedevel -Duse64bitall -Dusequadmath -Uuseperlio -des'
89*f2a19305Safresh1    hint=recommended
90*f2a19305Safresh1    useposix=true
91*f2a19305Safresh1    d_sigaction=define
92*f2a19305Safresh1    useithreads=undef
93*f2a19305Safresh1    usemultiplicity=undef
94*f2a19305Safresh1    use64bitint=define
95*f2a19305Safresh1    use64bitall=define
96*f2a19305Safresh1    uselongdouble=undef
97*f2a19305Safresh1    usemymalloc=n
98*f2a19305Safresh1    default_inc_excludes_dot=define
99*f2a19305Safresh1  Compiler:
100*f2a19305Safresh1    cc='cc'
101*f2a19305Safresh1    ccflags ='-pie -fPIE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
102*f2a19305Safresh1    optimize='-O2'
103*f2a19305Safresh1    cppflags='-pie -fPIE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include'
104*f2a19305Safresh1    ccversion=''
105*f2a19305Safresh1    gccversion='11.2.1 20211124 [revision 7510c23c1ec53aa4a62705f0384079661342ff7b]'
106*f2a19305Safresh1    gccosandvers=''
107*f2a19305Safresh1    intsize=4
108*f2a19305Safresh1    longsize=8
109*f2a19305Safresh1    ptrsize=8
110*f2a19305Safresh1    doublesize=8
111*f2a19305Safresh1    byteorder=12345678
112*f2a19305Safresh1    doublekind=3
113*f2a19305Safresh1    d_longlong=define
114*f2a19305Safresh1    longlongsize=8
115*f2a19305Safresh1    d_longdbl=define
116*f2a19305Safresh1    longdblsize=16
117*f2a19305Safresh1    longdblkind=3
118*f2a19305Safresh1    ivtype='long'
119*f2a19305Safresh1    ivsize=8
120*f2a19305Safresh1    nvtype='__float128'
121*f2a19305Safresh1    nvsize=16
122*f2a19305Safresh1    Off_t='off_t'
123*f2a19305Safresh1    lseeksize=8
124*f2a19305Safresh1    alignbytes=16
125*f2a19305Safresh1    prototype=define
126*f2a19305Safresh1  Linker and Libraries:
127*f2a19305Safresh1    ld='cc'
128*f2a19305Safresh1    ldflags ='-L/pro/local/lib -fstack-protector-strong'
129*f2a19305Safresh1    libpth=/usr/local/lib /usr/x86_64-suse-linux/lib /usr/lib /data/pro/local/lib /usr/lib64 /usr/local/lib64
130*f2a19305Safresh1    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat -lquadmath
131*f2a19305Safresh1    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -lquadmath
132*f2a19305Safresh1    libc=/lib/../lib64/libc.so.6
133*f2a19305Safresh1    so=so
134*f2a19305Safresh1    useshrplib=false
135*f2a19305Safresh1    libperl=libperl.a
136*f2a19305Safresh1    gnulibc_version='2.34'
137*f2a19305Safresh1  Dynamic Linking:
138*f2a19305Safresh1    dlsrc=dl_dlopen.xs
139*f2a19305Safresh1    dlext=so
140*f2a19305Safresh1    d_dlsymun=undef
141*f2a19305Safresh1    ccdlflags='-Wl,-E'
142*f2a19305Safresh1    cccdlflags='-fPIC'
143*f2a19305Safresh1    lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector-strong'
144*f2a19305Safresh1
145*f2a19305Safresh1
146*f2a19305Safresh1Characteristics of this binary (from libperl):
147*f2a19305Safresh1  Compile-time options:
148*f2a19305Safresh1    HAS_TIMES
149*f2a19305Safresh1    PERLIO_LAYERS
150*f2a19305Safresh1    PERL_COPY_ON_WRITE
151*f2a19305Safresh1    PERL_DONT_CREATE_GVSV
152*f2a19305Safresh1    PERL_MALLOC_WRAP
153*f2a19305Safresh1    PERL_OP_PARENT
154*f2a19305Safresh1    PERL_PRESERVE_IVUV
155*f2a19305Safresh1    PERL_USE_DEVEL
156*f2a19305Safresh1    USE_64_BIT_ALL
157*f2a19305Safresh1    USE_64_BIT_INT
158*f2a19305Safresh1    USE_LARGE_FILES
159*f2a19305Safresh1    USE_LOCALE
160*f2a19305Safresh1    USE_LOCALE_COLLATE
161*f2a19305Safresh1    USE_LOCALE_CTYPE
162*f2a19305Safresh1    USE_LOCALE_NUMERIC
163*f2a19305Safresh1    USE_LOCALE_TIME
164*f2a19305Safresh1    USE_PERLIO
165*f2a19305Safresh1    USE_PERL_ATOF
166*f2a19305Safresh1    USE_QUADMATH
167*f2a19305Safresh1  Built under linux
168*f2a19305Safresh1  Compiled at Jan  1 2022 11:18:27
169*f2a19305Safresh1  %ENV:
170*f2a19305Safresh1    PERL6LIB="inst#/pro/3gl/CPAN/rakudo/install"
171*f2a19305Safresh1  @INC:
172*f2a19305Safresh1    lib
173*f2a19305Safresh1    /pro/lib/perl5/site_perl/5.35.8/x86_64-linux-quadmath
174*f2a19305Safresh1    /pro/lib/perl5/site_perl/5.35.8
175*f2a19305Safresh1    /pro/lib/perl5/5.35.8/x86_64-linux-quadmath
176*f2a19305Safresh1    /pro/lib/perl5/5.35.8
177