Rename ext/Devel/DProf to ext/Devel-DProf
[p5sagit/p5-mst-13.2.git] / ext / Devel-PPPort / t / variables.t
1 ################################################################################
2 #
3 #            !!!!!   Do NOT edit this file directly!   !!!!!
4 #
5 #            Edit mktests.PL and/or parts/inc/variables instead.
6 #
7 #  This file was automatically generated from the definition files in the
8 #  parts/inc/ subdirectory by mktests.PL. To learn more about how all this
9 #  works, please read the F<HACKERS> file that came with this distribution.
10 #
11 ################################################################################
12
13 BEGIN {
14   if ($ENV{'PERL_CORE'}) {
15     chdir 't' if -d 't';
16     @INC = ('../lib', '../ext/Devel-PPPort/t') if -d '../lib' && -d '../ext';
17     require Config; import Config;
18     use vars '%Config';
19     if (" $Config{'extensions'} " !~ m[ Devel/PPPort ]) {
20       print "1..0 # Skip -- Perl configured without Devel::PPPort module\n";
21       exit 0;
22     }
23   }
24   else {
25     unshift @INC, 't';
26   }
27
28   sub load {
29     eval "use Test";
30     require 'testutil.pl' if $@;
31   }
32
33   if (49) {
34     load();
35     plan(tests => 49);
36   }
37 }
38
39 use Devel::PPPort;
40 use strict;
41 $^W = 1;
42
43 package Devel::PPPort;
44 use vars '@ISA';
45 require DynaLoader;
46 @ISA = qw(DynaLoader);
47 bootstrap Devel::PPPort;
48
49 package main;
50
51 ok(Devel::PPPort::compare_PL_signals());
52
53 ok(!defined(&Devel::PPPort::PL_sv_undef()));
54 ok(&Devel::PPPort::PL_sv_yes());
55 ok(!&Devel::PPPort::PL_sv_no());
56 ok(&Devel::PPPort::PL_na("abcd"), 4);
57 ok(&Devel::PPPort::PL_Sv(), "mhx");
58 ok(defined &Devel::PPPort::PL_tokenbuf());
59 ok($] >= 5.009005 || &Devel::PPPort::PL_parser());
60 ok(&Devel::PPPort::PL_hexdigit() =~ /^[0-9a-zA-Z]+$/);
61 ok(defined &Devel::PPPort::PL_hints());
62 ok(&Devel::PPPort::PL_ppaddr("mhx"), "MHX");
63
64 for (&Devel::PPPort::other_variables()) {
65   ok($_ != 0);
66 }
67
68 {
69   my @w;
70   my $fail = 0;
71   {
72     local $SIG{'__WARN__'} = sub { push @w, @_ };
73     ok(&Devel::PPPort::dummy_parser_warning());
74   }
75   if ($] >= 5.009005) {
76     ok(@w >= 0);
77     for (@w) {
78       print "# $_";
79       unless (/^warning: dummy PL_bufptr used in.*module3.*:\d+/i) {
80         warn $_;
81         $fail++;
82       }
83     }
84   }
85   else {
86     ok(@w == 0);
87   }
88   ok($fail, 0);
89 }
90
91 ok(&Devel::PPPort::no_dummy_parser_vars(1) >= ($] < 5.009005 ? 1 : 0));
92
93 eval { &Devel::PPPort::no_dummy_parser_vars(0) };
94
95 if ($] < 5.009005) {
96   ok($@, '');
97 }
98 else {
99   if ($@) {
100     print "# $@";
101     ok($@ =~ /^panic: PL_parser == NULL in.*module2.*:\d+/i);
102   }
103   else {
104     ok(1);
105   }
106 }
107