14 if (!-c "/dev/null") {
15 print "1..0 # Skip: no /dev/null\n";
18 my $dev_tty = '/dev/tty';
19 $dev_tty = 'TT:' if ($^O eq 'VMS');
21 print "1..0 # Skip: no $dev_tty\n";
25 print "1..0 # Skip: \$ENV{PERL5DB} is already set to '$ENV{PERL5DB}'\n";
33 open RC, ">", ".perldb" or die $!;
36 # overly permissive perms gives "Must not source insecure rcfile"
37 # and hangs at the DB(1> prompt
38 chmod 0644, ".perldb";
41 my $target = '../lib/perl5db/t/eval-line-bug';
45 &parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
57 "p \\\@{'main::_<$target'}",
64 local $ENV{PERLDB_OPTS} = "ReadLine=0";
65 runperl(switches => [ '-d' ], progfile => $target);
71 open I, "<", 'db.out' or die $!;
76 like($contents, qr/sub factorial/,
77 'The ${main::_<filename} variable in the debugger was not destroyed'
81 local $ENV{PERLDB_OPTS} = "ReadLine=0";
82 my $output = runperl(switches => [ '-d' ], progfile => '../lib/perl5db/t/lvalue-bug');
83 like($output, qr/foo is defined/, 'lvalue subs work in the debugger');
87 local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
88 my $output = runperl(switches => [ '-d' ], progfile => '../lib/perl5db/t/symbol-table-bug');
89 like($output, qr/Undefined symbols 0/, 'there are no undefined values in the symbol table');
93 if ( $Config{usethreads} ) {
94 skip('This perl has threads, skipping non-threaded debugger tests');
96 my $error = 'This Perl not built to support threads';
97 my $output = runperl( switches => [ '-dt' ], stderr => 1 );
98 like($output, qr/$error/, 'Perl debugger correctly complains that it was not built with threads');
103 if ( $Config{usethreads} ) {
104 local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
105 my $output = runperl(switches => [ '-dt' ], progfile => '../lib/perl5db/t/symbol-table-bug');
106 like($output, qr/Undefined symbols 0/, 'there are no undefined values in the symbol table when running with thread support');
108 skip("This perl is not threaded, skipping threaded debugger tests");
117 &parse_options("NonStop=0 TTY=db.out LineInfo=db.out");
122 push(\@DB::typeahead,
129 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-61222');
133 open I, "<", 'db.out' or die $!;
137 unlike($contents, qr/INCORRECT/, "[perl #61222]");
142 # Test for Proxy constants
146 &parse_options("NonStop=0 ReadLine=0 TTY=db.out LineInfo=db.out");
151 push(\@DB::typeahead,
158 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/proxy-constants');
159 is($output, "", "proxy constant subroutines");
163 # [perl #66110] Call a subroutine inside a regex
165 local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
166 my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-66110');
167 like($output, "All tests successful.", "[perl #66110]");
174 1 while unlink qw(.perldb db.out);