15 ok(keys %Config > 500, "Config has more than 500 entries");
19 is($Config{PERL_REVISION}, 5, "PERL_REVISION is 5");
21 # Check that old config variable names are aliased to their new ones.
22 my %grandfathers = ( PERL_VERSION => 'PATCHLEVEL',
23 PERL_SUBVERSION => 'SUBVERSION',
24 PERL_CONFIG_SH => 'CONFIG'
26 while( my($new, $old) = each %grandfathers ) {
27 isnt($Config{$new}, undef, "$new is defined");
28 is($Config{$new}, $Config{$old}, "$new is aliased to $old");
31 ok( exists $Config{cc}, "has cc");
33 ok( exists $Config{ccflags}, "has ccflags");
35 ok(!exists $Config{python}, "has no python");
37 ok( exists $Config{d_fork}, "has d_fork");
39 ok(!exists $Config{d_bork}, "has no d_bork");
41 like($Config{ivsize}, qr/^(4|8)$/, "ivsize is 4 or 8 (it is $Config{ivsize})");
43 # byteorder is virtual, but it has rules.
45 like($Config{byteorder}, qr/^(1234|4321|12345678|87654321)$/, "byteorder is 1234 or 4321 or 12345678 or 87654321 (it is $Config{byteorder})");
47 is(length $Config{byteorder}, $Config{ivsize}, "byteorder is as long as ivsize (which is $Config{ivsize})");
49 # ccflags_nolargefiles is virtual, too.
51 ok(exists $Config{ccflags_nolargefiles}, "has ccflags_nolargefiles");
56 # make sure we can export what we say we can export.
58 my @exports = qw(myconfig config_sh config_vars config_re);
59 Config->import(@exports);
60 foreach my $func (@exports) {
61 ::ok( __PACKAGE__->can($func), "$func exported" );
65 like(Config::myconfig(), qr/osname=\Q$Config{osname}\E/, "myconfig");
66 like(Config::config_sh(), qr/osname='\Q$Config{osname}\E'/, "config_sh");
67 like(join("\n", Config::config_re('c.*')),
68 qr/^c.*?=/, 'config_re' );
70 my $out = tie *STDOUT, 'FakeOut';
72 Config::config_vars('cc');
76 Config::config_vars('d_bork');
82 like($out1, qr/^cc='\Q$Config{cc}\E';/, "config_vars cc");
83 like($out2, qr/^d_bork='UNKNOWN';/, "config_vars d_bork is UNKNOWN");
88 eval { $Config{d_bork} = 'borkbork' };
89 like($@, qr/Config is read-only/, "no STORE");
91 ok(!exists $Config{d_bork}, "still no d_bork");
94 eval { delete $Config{d_fork} };
95 like($@, qr/Config is read-only/, "no DELETE");
97 ok( exists $Config{d_fork}, "still d_fork");
100 eval { %Config = () };
101 like($@, qr/Config is read-only/, "no CLEAR");
103 ok( exists $Config{d_fork}, "still d_fork");
109 bless(\(my $text), $_[0]);
118 $$self .= join('', @_);
122 # Signal-related variables
123 # (this is actually a regression test for Configure.)
125 ok((split / /, $Config{sig_num}) == $Config{sig_size}+1, "sig_size");
127 if ($^O eq 'hpux') { skip "HP-UX has SIGRTM(IN|AX) == -1" }
128 like($Config{sig_num}, qr/^[ \d]+\z/, "sig_num has only positive numbers");