xref: /openbsd-src/gnu/usr.bin/perl/cpan/Config-Perl-V/t/35_plv52910g.t (revision f2a19305cfc49ea4d1a5feb55cd6c283c6f1e031)
1#!/pro/bin/perl
2
3use strict;
4use warnings;
5
6BEGIN {
7    use Test::More;
8    my $tests = 134;
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 qw( summary );
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}, "Apr 13 2019 00:06:38", "Build time");
25is ($conf->{config}{version}, "5.29.10", "reconstructed \$Config{version}");
26
27my $opt = Config::Perl::V::plv2hash ("")->{build}{options};
28foreach my $o (sort qw(
29	DEBUGGING HAS_TIMES MULTIPLICITY PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV
30	PERL_IMPLICIT_CONTEXT PERLIO_LAYERS PERL_MALLOC_WRAP PERL_OP_PARENT
31	PERL_PRESERVE_IVUV PERL_TRACK_MEMPOOL PERL_USE_DEVEL USE_64_BIT_ALL
32	USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
33	USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_LONG_DOUBLE
34	USE_PERL_ATOF USE_PERLIO USE_REENTRANT_API USE_THREAD_SAFE_LOCALE
35	)) {
36    is ($conf->{build}{options}{$o}, 1, "Runtime option $o set");
37    delete $opt->{$o};
38    }
39foreach my $o (sort keys %$opt) {
40    is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset");
41    }
42
43eval { require Digest::MD5; };
44my $md5 = $@ ? "0" x 32 : "8404b533829bd9752df7f662a710f993";
45ok (my $sig = Config::Perl::V::signature ($conf), "Get signature");
46
47SKIP: {
48    ord "A" == 65 or skip "ASCII-centric test", 1;
49    is ($sig, $md5, "MD5");
50    }
51
52is_deeply ($conf->{build}{patches}, [
53    "SMOKEdfba4714a9dc4c35123b4df0a5e1721ccb081d97" ], "No local patches");
54
55my %check = (
56    alignbytes      => 16,
57    api_version     => 29,
58    bincompat5005   => "undef",
59    byteorder       => 12345678,
60    cc              => "g++",
61    cccdlflags      => "-fPIC",
62    ccdlflags       => "-Wl,-E",
63    config_args     => "-des -Dcc=g++ -Dusedevel -Duseithreads -Duse64bitall -Duselongdouble -DDEBUGGING",
64    gccversion      => "8.3.1 20190226 [gcc-8-branch revision 269204]",
65    gnulibc_version => "2.29",
66    ivsize          => 8,
67    ivtype          => "long",
68    ld              => "g++",
69    lddlflags       => "-shared -O2 -g -L/pro/local/lib -fstack-protector-strong",
70    ldflags         => "-L/pro/local/lib -fstack-protector-strong",
71    libc            => "libc-2.29.so",
72    lseektype       => "off_t",
73    osvers          => "5.0.7-1-default",
74    use64bitall     => "define",
75    use64bitint     => "define",
76    usemymalloc     => "n",
77    default_inc_excludes_dot
78		    => "define",
79    );
80is ($conf->{config}{$_}, $check{$_}, "reconstructed \$Config{$_}") for sort keys %check;
81
82ok (my $info = summary ($conf), "A summary");
83ok (exists $info->{$_}, "Summary has $_") for qw( cc config_args usemymalloc default_inc_excludes_dot );
84is ($info->{default_inc_excludes_dot}, "define", "This build has . NOT in INC");
85
86__END__
87Summary of my perl5 (revision 5 version 29 subversion 10) configuration:
88  Snapshot of: dfba4714a9dc4c35123b4df0a5e1721ccb081d97
89  Platform:
90    osname=linux
91    osvers=5.0.7-1-default
92    archname=x86_64-linux-thread-multi-ld
93    uname='linux lx09 5.0.7-1-default #1 smp sat apr 6 14:47:49 utc 2019 (8f18342) x86_64 x86_64 x86_64 gnulinux '
94    config_args='-des -Dcc=g++ -Dusedevel -Duseithreads -Duse64bitall -Duselongdouble -DDEBUGGING'
95    hint=recommended
96    useposix=true
97    d_sigaction=define
98    useithreads=define
99    usemultiplicity=define
100    use64bitint=define
101    use64bitall=define
102    uselongdouble=define
103    usemymalloc=n
104    default_inc_excludes_dot=define
105    bincompat5005=undef
106  Compiler:
107    cc='g++'
108    ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -DDEBUGGING -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
109    optimize='-O2 -g'
110    cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -DDEBUGGING -fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector-strong -I/pro/local/include'
111    ccversion=''
112    gccversion='8.3.1 20190226 [gcc-8-branch revision 269204]'
113    gccosandvers=''
114    intsize=4
115    longsize=8
116    ptrsize=8
117    doublesize=8
118    byteorder=12345678
119    doublekind=3
120    d_longlong=define
121    longlongsize=8
122    d_longdbl=define
123    longdblsize=16
124    longdblkind=3
125    ivtype='long'
126    ivsize=8
127    nvtype='long double'
128    nvsize=16
129    Off_t='off_t'
130    lseeksize=8
131    alignbytes=16
132    prototype=define
133  Linker and Libraries:
134    ld='g++'
135    ldflags ='-L/pro/local/lib -fstack-protector-strong'
136    libpth=/usr/include/c++/8 /usr/include/c++/8/x86_64-suse-linux /usr/include/c++/8/backward /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
137    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
138    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
139    libc=libc-2.29.so
140    so=so
141    useshrplib=false
142    libperl=libperl.a
143    gnulibc_version='2.29'
144  Dynamic Linking:
145    dlsrc=dl_dlopen.xs
146    dlext=so
147    d_dlsymun=undef
148    ccdlflags='-Wl,-E'
149    cccdlflags='-fPIC'
150    lddlflags='-shared -O2 -g -L/pro/local/lib -fstack-protector-strong'
151
152
153Characteristics of this binary (from libperl):
154  Compile-time options:
155    DEBUGGING
156    HAS_TIMES
157    MULTIPLICITY
158    PERLIO_LAYERS
159    PERL_COPY_ON_WRITE
160    PERL_DONT_CREATE_GVSV
161    PERL_IMPLICIT_CONTEXT
162    PERL_MALLOC_WRAP
163    PERL_OP_PARENT
164    PERL_PRESERVE_IVUV
165    PERL_TRACK_MEMPOOL
166    PERL_USE_DEVEL
167    USE_64_BIT_ALL
168    USE_64_BIT_INT
169    USE_ITHREADS
170    USE_LARGE_FILES
171    USE_LOCALE
172    USE_LOCALE_COLLATE
173    USE_LOCALE_CTYPE
174    USE_LOCALE_NUMERIC
175    USE_LOCALE_TIME
176    USE_LONG_DOUBLE
177    USE_PERLIO
178    USE_PERL_ATOF
179    USE_REENTRANT_API
180    USE_THREAD_SAFE_LOCALE
181  Locally applied patches:
182    SMOKEdfba4714a9dc4c35123b4df0a5e1721ccb081d97
183  Built under linux
184  Compiled at Apr 13 2019 00:06:38
185  %ENV:
186    PERL6LIB="inst#/pro/3gl/CPAN/rakudo/install"
187  @INC:
188    lib
189    /opt/perl/lib/site_perl/5.29.10/x86_64-linux-thread-multi-ld
190    /opt/perl/lib/site_perl/5.29.10
191    /opt/perl/lib/5.29.10/x86_64-linux-thread-multi-ld
192    /opt/perl/lib/5.29.10
193