1f3efcd01Safresh1#!/pro/bin/perl
2f3efcd01Safresh1
3f3efcd01Safresh1use strict;
4f3efcd01Safresh1use warnings;
5f3efcd01Safresh1
6f3efcd01Safresh1BEGIN {
7f3efcd01Safresh1    use Test::More;
8*f2a19305Safresh1    my $tests = 134;
9f3efcd01Safresh1    unless ($ENV{PERL_CORE}) {
10f3efcd01Safresh1	require Test::NoWarnings;
11f3efcd01Safresh1	Test::NoWarnings->import ();
12f3efcd01Safresh1	$tests++;
13f3efcd01Safresh1	}
14f3efcd01Safresh1
15f3efcd01Safresh1    plan tests => $tests;
16f3efcd01Safresh1    }
17f3efcd01Safresh1
18f3efcd01Safresh1use Config::Perl::V qw( summary );
19f3efcd01Safresh1
20f3efcd01Safresh1ok (my $conf = Config::Perl::V::plv2hash (<DATA>), "Read perl -v block");
21f3efcd01Safresh1ok (exists $conf->{$_}, "Has $_ entry") for qw( build environment config inc );
22f3efcd01Safresh1
23f3efcd01Safresh1is ($conf->{build}{osname}, $conf->{config}{osname}, "osname");
24f3efcd01Safresh1is ($conf->{build}{stamp}, "Jun 26 2018 12:17:32", "Build time");
25f3efcd01Safresh1is ($conf->{config}{version}, "5.28.0", "reconstructed \$Config{version}");
26f3efcd01Safresh1
27f3efcd01Safresh1my $opt = Config::Perl::V::plv2hash ("")->{build}{options};
28f3efcd01Safresh1foreach my $o (sort qw(
29f3efcd01Safresh1	HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE
30f3efcd01Safresh1	PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
31f3efcd01Safresh1	PERL_OP_PARENT PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT
32f3efcd01Safresh1	USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
33f3efcd01Safresh1	USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
34f3efcd01Safresh1	USE_LONG_DOUBLE USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API
35f3efcd01Safresh1	)) {
36f3efcd01Safresh1    is ($conf->{build}{options}{$o}, 1, "Runtime option $o set");
37f3efcd01Safresh1    delete $opt->{$o};
38f3efcd01Safresh1    }
39f3efcd01Safresh1foreach my $o (sort keys %$opt) {
40f3efcd01Safresh1    is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset");
41f3efcd01Safresh1    }
42f3efcd01Safresh1
43f3efcd01Safresh1eval { require Digest::MD5; };
44f3efcd01Safresh1my $md5 = $@ ? "0" x 32 : "4add7fd04b60c2048a46ff47087e6952";
45f3efcd01Safresh1ok (my $sig = Config::Perl::V::signature ($conf), "Get signature");
46*f2a19305Safresh1
47*f2a19305Safresh1SKIP: {
48*f2a19305Safresh1    ord "A" == 65 or skip "ASCII-centric test", 1;
49f3efcd01Safresh1    is ($sig, $md5, "MD5");
50*f2a19305Safresh1    }
51f3efcd01Safresh1
52f3efcd01Safresh1is_deeply ($conf->{build}{patches}, [], "No local patches");
53f3efcd01Safresh1
54f3efcd01Safresh1my %check = (
55f3efcd01Safresh1    alignbytes      => 16,
56f3efcd01Safresh1    api_version     => 28,
57f3efcd01Safresh1    bincompat5005   => "undef",
58f3efcd01Safresh1    byteorder       => 12345678,
59f3efcd01Safresh1    cc              => "cc",
60f3efcd01Safresh1    cccdlflags      => "-fPIC",
61f3efcd01Safresh1    ccdlflags       => "-Wl,-E",
62f3efcd01Safresh1    config_args     => "-Dusethreads -Duseithreads -Duse64bitall -Duselongdouble -des",
63f3efcd01Safresh1    gccversion      => "8.1.1 20180523 [gcc-8-branch revision 260570]",
64f3efcd01Safresh1    gnulibc_version => "2.27",
65f3efcd01Safresh1    ivsize          => 8,
66f3efcd01Safresh1    ivtype          => "long",
67f3efcd01Safresh1    ld              => "cc",
68f3efcd01Safresh1    lddlflags       => "-shared -O2 -L/pro/local/lib -fstack-protector-strong",
69f3efcd01Safresh1    ldflags         => "-L/pro/local/lib -fstack-protector-strong",
70f3efcd01Safresh1    libc            => "libc-2.27.so",
71f3efcd01Safresh1    lseektype       => "off_t",
72f3efcd01Safresh1    osvers          => "4.17.2-1-default",
73f3efcd01Safresh1    use64bitall     => "define",
74f3efcd01Safresh1    use64bitint     => "define",
75f3efcd01Safresh1    usemymalloc     => "n",
76f3efcd01Safresh1    default_inc_excludes_dot
77f3efcd01Safresh1		    => "define",
78f3efcd01Safresh1    );
79f3efcd01Safresh1is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check;
80f3efcd01Safresh1
81f3efcd01Safresh1ok (my $info = summary ($conf), "A summary");
82f3efcd01Safresh1ok (exists $info->{$_}, "Summary has $_") for qw( cc config_args usemymalloc default_inc_excludes_dot );
83f3efcd01Safresh1is ($info->{default_inc_excludes_dot}, "define", "This build has . NOT in INC");
84f3efcd01Safresh1
85f3efcd01Safresh1__END__
86f3efcd01Safresh1Summary of my perl5 (revision 5 version 28 subversion 0) configuration:
87f3efcd01Safresh1
88f3efcd01Safresh1  Platform:
89f3efcd01Safresh1    osname=linux
90f3efcd01Safresh1    osvers=4.17.2-1-default
91f3efcd01Safresh1    archname=x86_64-linux-thread-multi-ld
92f3efcd01Safresh1    uname='linux lx09 4.17.2-1-default #1 smp preempt sat jun 16 10:58:03 utc 2018 (ddde22d) x86_64 x86_64 x86_64 gnulinux '
93f3efcd01Safresh1    config_args='-Dusethreads -Duseithreads -Duse64bitall -Duselongdouble -des'
94f3efcd01Safresh1    hint=recommended
95f3efcd01Safresh1    useposix=true
96f3efcd01Safresh1    d_sigaction=define
97f3efcd01Safresh1    useithreads=define
98f3efcd01Safresh1    usemultiplicity=define
99f3efcd01Safresh1    use64bitint=define
100f3efcd01Safresh1    use64bitall=define
101f3efcd01Safresh1    uselongdouble=define
102f3efcd01Safresh1    usemymalloc=n
103f3efcd01Safresh1    default_inc_excludes_dot=define
104f3efcd01Safresh1    bincompat5005=undef
105f3efcd01Safresh1  Compiler:
106f3efcd01Safresh1    cc='cc'
107f3efcd01Safresh1    ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
108f3efcd01Safresh1    optimize='-O2'
109f3efcd01Safresh1    cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include'
110f3efcd01Safresh1    ccversion=''
111f3efcd01Safresh1    gccversion='8.1.1 20180523 [gcc-8-branch revision 260570]'
112f3efcd01Safresh1    gccosandvers=''
113f3efcd01Safresh1    intsize=4
114f3efcd01Safresh1    longsize=8
115f3efcd01Safresh1    ptrsize=8
116f3efcd01Safresh1    doublesize=8
117f3efcd01Safresh1    byteorder=12345678
118f3efcd01Safresh1    doublekind=3
119f3efcd01Safresh1    d_longlong=define
120f3efcd01Safresh1    longlongsize=8
121f3efcd01Safresh1    d_longdbl=define
122f3efcd01Safresh1    longdblsize=16
123f3efcd01Safresh1    longdblkind=3
124f3efcd01Safresh1    ivtype='long'
125f3efcd01Safresh1    ivsize=8
126f3efcd01Safresh1    nvtype='long double'
127f3efcd01Safresh1    nvsize=16
128f3efcd01Safresh1    Off_t='off_t'
129f3efcd01Safresh1    lseeksize=8
130f3efcd01Safresh1    alignbytes=16
131f3efcd01Safresh1    prototype=define
132f3efcd01Safresh1  Linker and Libraries:
133f3efcd01Safresh1    ld='cc'
134f3efcd01Safresh1    ldflags ='-L/pro/local/lib -fstack-protector-strong'
135f3efcd01Safresh1    libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64
136f3efcd01Safresh1    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
137f3efcd01Safresh1    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
138f3efcd01Safresh1    libc=libc-2.27.so
139f3efcd01Safresh1    so=so
140f3efcd01Safresh1    useshrplib=false
141f3efcd01Safresh1    libperl=libperl.a
142f3efcd01Safresh1    gnulibc_version='2.27'
143f3efcd01Safresh1  Dynamic Linking:
144f3efcd01Safresh1    dlsrc=dl_dlopen.xs
145f3efcd01Safresh1    dlext=so
146f3efcd01Safresh1    d_dlsymun=undef
147f3efcd01Safresh1    ccdlflags='-Wl,-E'
148f3efcd01Safresh1    cccdlflags='-fPIC'
149f3efcd01Safresh1    lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector-strong'
150f3efcd01Safresh1
151f3efcd01Safresh1
152f3efcd01Safresh1Characteristics of this binary (from libperl):
153f3efcd01Safresh1  Compile-time options:
154f3efcd01Safresh1    HAS_TIMES
155f3efcd01Safresh1    MULTIPLICITY
156f3efcd01Safresh1    PERLIO_LAYERS
157f3efcd01Safresh1    PERL_COPY_ON_WRITE
158f3efcd01Safresh1    PERL_DONT_CREATE_GVSV
159f3efcd01Safresh1    PERL_IMPLICIT_CONTEXT
160f3efcd01Safresh1    PERL_MALLOC_WRAP
161f3efcd01Safresh1    PERL_OP_PARENT
162f3efcd01Safresh1    PERL_PRESERVE_IVUV
163f3efcd01Safresh1    USE_64_BIT_ALL
164f3efcd01Safresh1    USE_64_BIT_INT
165f3efcd01Safresh1    USE_ITHREADS
166f3efcd01Safresh1    USE_LARGE_FILES
167f3efcd01Safresh1    USE_LOCALE
168f3efcd01Safresh1    USE_LOCALE_COLLATE
169f3efcd01Safresh1    USE_LOCALE_CTYPE
170f3efcd01Safresh1    USE_LOCALE_NUMERIC
171f3efcd01Safresh1    USE_LOCALE_TIME
172f3efcd01Safresh1    USE_LONG_DOUBLE
173f3efcd01Safresh1    USE_PERLIO
174f3efcd01Safresh1    USE_PERL_ATOF
175f3efcd01Safresh1    USE_REENTRANT_API
176f3efcd01Safresh1  Built under linux
177f3efcd01Safresh1  Compiled at Jun 26 2018 12:17:32
178f3efcd01Safresh1  @INC:
179f3efcd01Safresh1    /pro/lib/perl5/site_perl/5.28.0/x86_64-linux-thread-multi-ld
180f3efcd01Safresh1    /pro/lib/perl5/site_perl/5.28.0
181f3efcd01Safresh1    /pro/lib/perl5/5.28.0/x86_64-linux-thread-multi-ld
182f3efcd01Safresh1    /pro/lib/perl5/5.28.0
183