2 # Copyright (C) 2008, The Perl Foundation.
5 # initial work by Brad Gilbert b2gills <at> gmail <dot> com
9 use lib qw( . lib ../lib ../../lib );
11 use Test::More import => [ '$TODO' ];
12 use Parrot::Test tests => 8;
19 t/op/sysinfo.t - System Info
23 % prove t/op/sysinfo.t
27 Tests for basic system information.
31 =item 1 The size of a platform integer
33 =item 2 The size of a platform float
35 =item 3 The size of a platform pointer. (Largest possible data pointer)
39 =item 5 The OS version string
41 =item 6 The OS version number string
43 =item 7 The CPU architecture
53 pasm_output_is( <<'CODE', $PConfig{intvalsize}, "sysinfo integer size" );
59 # XXX is 'doublesize' the right thing to use?
60 pasm_output_is( <<'CODE', $PConfig{doublesize}, "sysinfo float size" );
66 pasm_output_is( <<'CODE', $PConfig{ptrsize}, "sysinfo pointer size" );
72 pasm_output_is( <<'CODE', $PConfig{osname}, "sysinfo osname" );
79 if( $PConfig{osname} eq 'MSWin32' ){
82 eval{ require Win32; } or
83 skip "requires package Win32 for these tests", 2;
85 # specifically don't use $Config{osvers}
86 # because it probably was the system perl was compiled on
87 # and we can do much better than that
89 my $osname = Win32::GetOSName();
90 $osname = 'WinXP' if $osname =~ m/^WinXP/;
92 local $TODO = "Not Currently Implemented";
93 pasm_output_is( <<'CODE', $osname, "sysinfo OS version string" );
99 my($osvername,$major,$minor,$id) = Win32::GetOSVersion();
101 pasm_output_is( <<'CODE', "$major.$minor", "sysinfo OS version number string" );
112 # XXX I know this is wrong on Win32 but is it correct on any others?
113 # XXX also should it be %Config or %PConfig
115 local $TODO = "Not Currently Implemented";
117 pasm_output_is( <<'CODE', $Config{osvers}, "sysinfo OS version string" );
123 pasm_output_is( <<'CODE', $Config{osvers}, "sysinfo OS version number string" );
135 local $TODO = "Not Currently Implemented";
137 pasm_output_is( <<'CODE', $PConfig{cpuarch}, "sysinfo CPU Arch Family" );
147 skip "Requires a lot of work to find out the correct answer", 1;
149 pasm_output_is( <<'CODE', $PConfig{archname}, "sysinfo CPU Model" );