1#!/pro/bin/perl
2
3use strict;
4use warnings;
5
6BEGIN {
7    use Test::More;
8    my $tests = 106;
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}, "Mar 23 2010 17:34:56", "Build time");
25is ($conf->{config}{"package"}, "perl5", "reconstructed \%Config{package}");
26is ($conf->{config}{version}, "5.6.2", "reconstructed \%Config{version}");
27
28my $opt = Config::Perl::V::plv2hash ("")->{build}{options};
29foreach my $o (sort qw(
30	DEBUGGING USE_64_BIT_INT USE_LARGE_FILES
31	)) {
32    is ($conf->{build}{options}{$o}, 1, "Runtime option $o set");
33    delete $opt->{$o};
34    }
35foreach my $o (sort keys %$opt) {
36    is ($conf->{build}{options}{$o}, 0, "Runtime option $o unset");
37    }
38
39eval { require Digest::MD5; };
40my $md5 = $@ ? "0" x 32 : "9dc187182be100c1713f210a8c6d9f45";
41ok (my $sig = Config::Perl::V::signature ($conf), "Get signature");
42
43SKIP: {
44    ord "A" == 65 or skip "ASCII-centric test", 1;
45    is ($sig, $md5, "MD5");
46    }
47
48__END__
49Summary of my perl5 (revision 5.0 version 6 subversion 2) configuration:
50  Platform:
51    osname=linux, osvers=2.6.31.12-0.2-default, archname=i686-linux-64int-perlio
52    uname='linux nb09 2.6.31.12-0.2-default #1 smp 2010-03-16 21:25:39 +0100 i686 i686 i386 gnulinux '
53    config_args='-Dusedevel -Duse64bitint -Duseperlio -des -Dusedevel -Uinstallusrbinperl -Dprefix=/media/Tux/perls'
54    hint=recommended, useposix=true, d_sigaction=define
55    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
56    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
57    use64bitint=define use64bitall=undef uselongdouble=undef
58  Compiler:
59    cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
60    optimize='-O2',
61    cppflags='-DDEBUGGING -fno-strict-aliasing -I/pro/local/include'
62    ccversion='', gccversion='4.4.1 [gcc-4_4-branch revision 150839]', gccosandvers=''
63    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
64    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
65    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
66    alignbytes=4, usemymalloc=n, prototype=define
67  Linker and Libraries:
68    ld='cc', ldflags ='-L/pro/local/lib'
69    libpth=/pro/local/lib /lib /usr/lib /usr/local/lib
70    libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
71    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
72    libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl.a
73  Dynamic Linking:
74    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
75    cccdlflags='-fpic', lddlflags='-shared -L/pro/local/lib'
76
77
78Characteristics of this binary (from libperl):
79  Compile-time options: DEBUGGING USE_64_BIT_INT USE_LARGE_FILES
80  Built under linux
81  Compiled at Mar 23 2010 17:34:56
82  @INC:
83    /media/Tux/perls/lib/5.6.2/i686-linux-64int-perlio
84    /media/Tux/perls/lib/5.6.2
85    /media/Tux/perls/lib/site_perl/5.6.2/i686-linux-64int-perlio
86    /media/Tux/perls/lib/site_perl/5.6.2
87    /media/Tux/perls/lib/site_perl
88    .
89